views:

66

answers:

3

My php.ini has a memory_limit of 256M. phpinfo() reflects this. But from within PHP, ini_get('memory_limit'); returns 32M. My fatal errors for exceeding memory limit also say that the max is 32M.

Any ideas why phpinfo() is lying to me?

+1  A: 

are one of the results from cli, and the other from web?

KikoV
No, I created a phpinfo.php file that just dumps phpinfo(); and I did a die(ini_get('memory_limit')); in the other php file, so they're both from the web.
Aaron Carlino
This is likely. Check the results of `phpinfo()`, the list of php.ini files *and directories scanned for additional ini files* should be present.
Charles
Interesting. I have:Configuration File (php.ini) Path /usr/libLoaded Configuration File /[path_to_public_html]/php.iniScan this dir for additional .ini files (none)additional .ini files parsed (none)What do you make of that? What's the difference between "configuration file" and "loaded configuration file?"
Aaron Carlino
A: 

have you tried setting the limit with PHP code as a test?

ini_set('memory_limit', '256M');

dpmguise
Yeah, that does nothing.
Aaron Carlino
A: 

It's possible to override php.ini parameters in the Apache configuration files.

Depending on the system, their location may vary, but check anything under /etc/apache2, /etc/apache2/conf.d, /etc/apache2/sites-enabled

thomasrutter