PDA

View Full Version : PHP error


Evoleto
05-05-2005, 10:53 AM
Hi,

I get the following error when accessing a *particular* php script:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 12 bytes) in x.php on line y

I made some research and even if my VPS plan has the lowest RAM resources, the free resources at that specific moment look good.

Is this from the PHP distribution I'm using or from the script itself?

Thank you!

esc
05-06-2005, 05:16 AM
I think you should increase the memory_limit value in your /etc/php.ini from 8 M to something higher. 30 M suffices for most applications.

Erich

Evoleto
05-11-2005, 03:55 AM
Indeed, the script was weird, wasting memory on some useless arrays.

The funny thing is that I'm familiar with php.ini settings, but I cannot find it anymore. AFAIK usually it resides in /etc, but it's not there and locate php.ini shows up nothing :(

I run PHP 4.3.10, not installed as binary but compiled by me.

Any clues?

Thank you.

esc
05-11-2005, 04:34 AM
... locate php.ini shows up nothing
Probably you have installed it into a different location. Do an updatedb first and try locate again or wait one day and cron will update the slocate DB for you.

Or you search it with find / -name php.ini ...

Erich

Tomas
05-12-2005, 06:27 AM
Did you try at /usr/local/Zend/etc/php.ini ? When you install Zend Optimizer, the php.ini file is there. Also, the locate command needs to be updated manually if it's not in a cronjob. To do this just run "locate -u" as root.

Evoleto
05-13-2005, 06:52 PM
Hi,

Thanks for the posts Esc & Tomas!

I'm doing sysadmin pretty good, so issues regarding the database of the slocate utiliuty and fining php.ini are out of discussion, and I guess that's why I'm so intrigued by this. It is not a big problem now that I can't raise the limit, but drives me mad that I dont' have total contriol on PHP settings.

Doing some mixed searches I found the /etc/php.d directory, but the .ini files within just load the mysql, pgsql etc modules. Maybe this rings a bell to someone whom had this problem.

esc
05-14-2005, 04:50 AM
You might perhaps run phpinfo(); and have a look at it's output. The current configuration file path is shown here as one of the first items. If the file is really missing from your system this might be an installation problem. But I think PHP would not load at all in this case. Anyway, I myself have upgraded PHP to 4.3.11 (from ART repository) recently using yum and it runs like a charm. If your installation is trashed, you might consider this as an easy fix.

Erich