View Full Version : Cannot set memory_limit in php.ini?
grasland
2005-10-04, 10:07 AM CDT
Hi,
I'm trying to enlarge the memory_limit. Phpinfo shows it's set to 8M. I want to make it 16M. But I didn't find this value in php.ini. So I added it (memory_limit = 16M) and restarted the webserver. But phpinfo still shows the memory_limit to be 8M.
Can anyone tell how can I up the memory_limit on Fedora Core 3?
rioguia
2005-10-04, 01:22 PM CDT
Sorry if this is too basic a response but did you try the following before you reloaded your php.ini file?
service httpd restart
or
apachectl graceful
wdingus
2005-10-04, 06:35 PM CDT
The only other memory related value I've ever had to change was LimitRequestBody in /etc/httpd/conf.d/php.conf It doesn't sound like it's what you're looking for, memory_limit in /etc/php.ini should do the trick. You restarted httpd after changing it I suppose?
rioguia
2005-10-04, 10:24 PM CDT
and cleared your browser's cache?
grasland
2005-10-05, 02:03 AM CDT
Thanks wdingus & rioguia. Solved it... the problem was in the php.ini file. This wasn't parsed correctly because of an error in this file. So the changes didn't make a difference. For people having similar problems, check the apache error_log for something like this:
PHP: Error parsing /etc/php.ini on line ??
Find the error, correct it and restart apache. This should do the job.
wizard
2005-10-05, 10:20 AM CDT
If the web directory you're using has the proper AllowOverride directive in httpd.conf you can also override the memory limit in php.ini with an .htaccess file - which is the method I prefer. All your .htaccess needs is a single line -
php_value memory_limit 16M
I find this gives me a little better control over memory usage but it's not without server overhead. If the AllowOverride setting is not 'None' apache will look for an .htaccess file every time there's a request to that directory. For me it's still a fair trade.
webxser
2005-12-19, 02:29 AM CST
I got an error "..../.htaccess: php_value not allowed here" if I only add the line
php_value memory_limit 16M
in the .htaccess, what is the problem? Any security setting on FC4 to overcome the problem?
wizard
2005-12-19, 07:15 AM CST
Hi, webxser -
You need an AllowOverride directive in httpd.conf in order to issue php parameters in .htaccess.
webxser
2005-12-25, 06:20 AM CST
Hi, webxser -
You need an AllowOverride directive in httpd.conf in order to issue php parameters in .htaccess.
Except for the All attribute, what attribute in AllowOverride should be applied in order to issue php parameters in .htaccess
wizard
2005-12-28, 05:18 AM CST
Except for the All attribute, what attribute in AllowOverride should be applied in order to issue php parameters in .htaccess
If you'd rather not use 'AllowOverride All' you can use 'AllowOverride Options'.
Hope this helps -
vBulletin® v3.8.1, Copyright ©2000-2010, Jelsoft Enterprises Ltd.