One of the most common errors you can face managing your website is Internal Server Error 500. There are many reasons why error 500 can occur and one of them is PHP memory limit which is set below your script minimum requirements.
In this article we will learn how to check if error 500 caused by hitting the memory limit and how to increase this limit in WHM, cPanel.
Identifying the cause of Error 500
Whenever you face any unknown error at your website, especially Internal Server Error 500, you need to check log files. cPanel log files will be located in either one of two places:
Quick check on this file shows:
The above picture illustrates, what message you will see in the error_log, in case your website is hitting the memory limit. Now let’s increase the PHP memory limit.
Increase PHP memory limit in WHM
There are multiple places where you can increase memory limit and one of them is WHM.
- You need to go to “MultiPHP Manager” and check which PHP version your website uses.
- Go to “MultiPHP INI Editor”, select the PHP version you will be increasing the limit for and increase the limit.
Select your PHP version under “Configure basic settings of a PHP version”. In our example, it’s PHP 8.0.
On the same page, find memory_limit. It might be set to 32M or 64M by default and you most likely want to increase it either to 128M or 256M.
Apply the changes and reboot Apache.
Increase PHP memory limit in cPanel
Sometimes it’s not enough to set memory limit in WHM and you will need to increase the limit locally in cPanel as well. To do it, login to cPanel. Again, first find “MultiPHP Manager” and check your website PHP version.
Second, find “MultiPHP INI Editor” and increase the PHP limit:
That’s it. Do not forget to save the changes and restart Apache. After these easy steps, your website is most likely get back to normal. In case you are being hosted with yohost.org, do not hesitate to open a support ticket and our team will do the best to assist you.