cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Increase php memory_limit

I need to increase the php memory limit on my hosting, it’s currently at 64M, so I go to Cpanel > Select PHP version > Switch To PHP Options and under memory_limit I change this to 256M and save.
Next I go to Cpanel > PHP Processes > Kill Processes
When I go to Cpanel > PHP it still shows memory_limit as 64M?

 

Any ideas?

 

Thanks

10 REPLIES 10
Community Manager
Community Manager

Re: Increase php memory_limit

Hi, @HenrysCat. To update your memory limit on our cPanel Hosting plans, you'll want to upload or create a .user.ini file in the /public_html directory. In that file, you'd enter the following code: 

memory_limit = XM

You would substitute the amount of memory you want in megabytes for the X in the statement above.  For example, if you wanted 500 MB, then you'd have '500M' after the equal sign. 

Once you do that, the limit should change. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.
Helper IV
Helper IV
Solution

Re: Increase php memory_limit

Hi, Follow the tutorial below.

 

I have created a video based on PHP Memory Limit, Executive Time, Post Max, Upload Max FileSize.

I have attached a video File below. Easy to understand. Just follow the tutorials below and increase your default PHP Limit.

 

Update: https://goo.gl/e81abo

 

 Thank You.

Re: Increase php memory_limit

I'm trying to install modules from magento 2.2 and need 756m to work. How can I proceed?

Re: Increase php memory_limit

try to increase Memory_limit  to 1G But  I Can't  locate my php.ini and i made my own php.ini but still not work > and i use php  Option  max increase is 512m  .

Re: Increase php memory_limit

Thank you so much for the video. 

someone who has no idea what to do could do it on her own!

THANK YOU!

Re: Increase php memory_limit

I too have the same problem, and Now Godaddy is asking for money to increase php memory limit, I have Bought 2 gb shared hosting from them, These guys are cheaters and will not be there in the market down the line 2 years, every client will move out of there services, 

Re: Increase php memory_limit

For everyone else that is searching for an answer here, I finally found a solution (after 2 full days of troubleshooting and zero luck with technical support).

 

My phpinfo.php file listed a 2G memory_limit and a master value of 512M but Magento 2 readiness check kept telling me 512 was set.

 

Setup:
Magento 2.2.5, PHP version: 7.0.3

 

Godaddy Business Hosting (Grow) - This is comparable to a shared hosting service but with allocated resources similar to a VPS server. You cannot modify the master php file but you can add your own .user.ini file to rewrite scripts.

 

The main issue is that this shared server has the option to select multiple PHP versions (MultiPHP Manager). When you select your version (in this case PHP 7.0), be sure to not to modify any of the "Switch to PHP Options" settings. Adding extensions are fine (you will need to add xsl and zip anyway to use Magento 2). If you modify any of the settings in the "PHP Options" console, it will call these master values every time. Leave them all as default (128M memory_limit, etc). In my case, I modified it to 512M from the default 128M and spent countless hours trying to troubleshoot why it was reading 512M instead of my local 2G value.

 

Be sure to set up the proper cron jobs to call your local .user.ini file with the correct memory_limit value.

 

Cron jobs looked like this:

/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<USERNAME>/public_html/var/log/magento.cron.log
/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/update/cron.php >> /home/<USERNAME>/public_html/var/log/update.cron.log
/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/bin/magento setup:cron:run >> /home/<USERNAME>/public_html/var/log/setup.cron.log

 

Notice the local .user.ini file being called after the master php folder instead of the file "php -i" was telling me to call (/opt/alt/php70/etc/php.ini).

 

Don't know if these two steps were necessary but I did it anyway:

Flushed cache in ssh

php /home/<USERNAME>/public_html/commerce/bin/magento cache:flush

 

Kill PHP Processes to restart (cPanel > PHP Processes > Kill Processes)

 

Note - I also updated my .htaccess file to a 2G memory_limit as well just to keep things consistent.

 

I checked my update.log file and the errors are no more. I also ran a readiness check and it finally passed.

 

Hope this helps everyone else.

Solution

Re: Increase php memory_limit

For everyone else that is searching for an answer here, I finally found a solution (after 2 full days of troubleshooting and zero luck with technical support).

 

My phpinfo.php file listed a 2G memory_limit and a master value of 512M but Magento 2 readiness check kept telling me 512 was set.

 

Setup:
Magento 2.2.5, PHP version: 7.0.3

 

Godaddy Business Hosting (Grow) - This is comparable to a shared hosting service but with allocated resources similar to a VPS server. You cannot modify the master php file but you can add your own .user.ini file to rewrite scripts.

 

The main issue is that this shared server has the option to select multiple PHP versions (MultiPHP Manager). When you select your version (in this case PHP 7.0), be sure to not to modify any of the "Switch to PHP Options" settings. Adding extensions are fine (you will need to add xsl and zip anyway to use Magento 2). If you modify any of the settings in the "PHP Options" console, it will call these master values every time. Leave them all as default (128M memory_limit, etc). In my case, I modified it to 512M from the default 128M and spent countless hours trying to troubleshoot why it was reading 512M instead of my local 2G value.

 

Be sure to set up the proper cron jobs to call your local .user.ini file with the correct memory_limit value.

 

Cron jobs looked like this:

/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<USERNAME>/public_html/var/log/magento.cron.log
/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/update/cron.php >> /home/<USERNAME>/public_html/var/log/update.cron.log
/usr/local/bin/php -c /home/<USERNAME>/public_html/.user.ini /home/<USERNAME>/public_html/bin/magento setup:cron:run >> /home/<USERNAME>/public_html/var/log/setup.cron.log

 

Notice the local .user.ini file being called after the master php folder instead of the file "php -i" was telling me to call (/opt/alt/php70/etc/php.ini).

 

Don't know if these two steps were necessary but I did it anyway:

Flushed cache in ssh

php /home/<USERNAME>/public_html/bin/magento cache:flush

 

Kill PHP Processes to restart (cPanel > PHP Processes > Kill Processes)

 

Note - I also updated my .htaccess file to a 2G memory_limit as well just to keep things consistent.

 

I checked my update.log file and the errors are no more. I also ran a readiness check and it finally passed.

 

Hope this helps everyone else.

Re: Increase php memory_limit

Holy thread back from the dead Batman Smiley LOL