PHP Problem...

They have: 35 posts

Joined: Aug 2001

I have just installed a search engine (Mazot v 0.0.7) and when I try and search for something via search.htm I get this error at the bottom of search.php

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3663 bytes in /web/sites/298/khantog/www.centrepointstation.net/galaxymap/pathlisting.php on line 94

Any idea how to fix this?

It looks like a general error to me. The line in pathlisting.php it refers to is as follows:

$filePath = $path . "/" . $file;

They have: 35 posts

Joined: Aug 2001

anyone?

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I'm guessing it could be a problem with $path or $file. What are the variable values?

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

I would say that you actually have 2 problems. The one that is causing the error is because your script is using up more than 8mb of memory in it's search. Php.ini, your control file for PHP, has 8Mb as the default value for the upper memory limit. You can't really fix this problem unless you can talk your host into increasing the memory limit.
But the 2nd problem is why is this script pulling so much data that it is generating this error. It appears in looking at the above $path . "/" . $file; that it is doing a search for a file in a directory. It also appears that because of the "/" part, that if there were no values for $path or $file, that it would do a search for every file in the root directory. It is kind of an odd way to write a script. What it is saying is that if my path is /home/username and the file is filename, then it would search for /home/username/filename . I would change the path to /home/username/ and change the line to $filePath = $path.$file; .

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 6 posts

Joined: Apr 2002

cheers for the help.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.