cPanel not starting with Internal Server Error – fix

The problem:

All websites are down with Internal Server Error 500

Symptoms:

Cpanel wasn’t loading with the following error:

Internal Server Error

500

Can’t fork: Cannot allocate memory at /usr/local/cpanel/Cpanel/SafeRun/InOut.pm line 40.
cpsrvd/11.62.0.15 Server at hostname.example.com

How I fixed it?

First of all I was trying to increase this limit by searching for “Max cPanel process memory” in:
“WHM Home » Server Configuration » Tweak Settings”

It was already over 512MB, the default value of 768MB. I increased to 1024MB. The Cpanel restart was unsuccessful.

As last resort I run the following commands:

/scripts/upcp –force

service cpanel restart

The first command will upgrade cPanel even if you got latest version of cPanel, in order to rule out any update inconsistencies.  Depending on the server configuration, this may run for about 10 minutes.

The second command will restart cPanel.

I hope that was helpful for you.