Hi
I am using a 1GB Droplet with current kernel: Ubuntu 14.04 x64 vmlinuz-3.13.0-24-generic (1221)
Using phpinfo() I have identified the currently loaded php.ini file, and have updated the memory_limit attribute to 512M from 128.
This file is /etc/php5/fpm/php.ini
Despite making this change (and of course restarting nginx and php5-fpm services - as well as rebooting the entire server after each change), the value shown in phpinfo() remains at 128M
Other things I’ve tried (again, have rebooted/restarted services):
php_admin_value[memory_limit] = 512M
php_value[memory_limit] = 512M
Adding a user.ini file in /etc/php5/fpm/conf.d/ (as this directory is scanned for other config files) - and adding the memory_limit with 512M memory
Editing /etc/php5/cli/php.ini to the same 512M value, even though this file isn’t being used.
Adding a php.ini file with the updated memory_limit value inside the root of the web site’s directory
I am absolutely stumped, and if someone can offer any insights or further troubleshooting steps, I would be greatly appreciative!
Thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello, all
You can create a php info file in order to check the current values and check which is the php.ini file in use. Create the following file in your public_hmtl folder - phpinfo.php and put the following code inside it:
You can also use the following command in order to find the location of the php.ini file:
php -i | grep php.ini
The output will be:
Then check for the current value of memory_limit you can also check which is the configuration file - php.ini that is currently used and apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites). Ideally you would like to have the following values:
memory_limit = 256M
You also need to restart your web server in order the changes to take effect.
Hope that this helps! Regards, Alex
I found it was because
memory_limit
appeared multiple times in the php.ini 😑 Not sure why - the whole contents repeated 3 times in the one file.Maybe it’s too late but just for reference as I wasted three hours trying to increase the memory limit for Magento.
Turns out that this was set in the
.htaccess
file for the virtual host.Hi Enigma
Wow - great tips; thanks for sending such a detailed list.
So, to answer your questions in order:
post_max_size
will have an impact on memory_limit, but when I change thepost_max_size
value in the same PHP.ini file, it is reflected in phpinfo()[17-May-2015 16:44:57] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
So other than point 6 - where the php.ini files don’t reconcile, it all seems to check out OK. Perhaps I have to check out the suhosin stuff more, but as I said - I didn’t have much luck finding out how to configure this. Any other thoughts or pointers are of course welcomed!
Regards
Hi smarterdigitalltd,
What version of php are you using exactly?
I’m not sure what the problem is, but I thought the following might help:
post_max_size
?ini_set("memory_limit","256M");
Hope this helps.