Jailed Shell memory issue

If you are using Secure Shell (SSH), you might get these error when you running your php script.

PHP Fatal error:  Out of memory (allocated 20447232) (tried to allocate 4096 bytes) in email.php

If you are the programmer or system administrator, you might tried to increase the memory_limit from the php.ini or using ini_set to increase the memory_limit but you will find out no matter how much memory_limit you set will not solve the problem.

The reason of the error occurs is not because of the PHP memory_limit usage of your script, but it is because the jailed shell limitation.

With cPanel jailed shell, the problem could caused by the forkbomb setting of your cPanel limited the PHP memory.

You may easily get this fix by modify the file as detail below where you should change the user to the cPanel user of your account.

Search for,
if [ “$LIMITUSER” != “root” ]; then

Then modify the ulimit “-m 200000” to “-m unlimited” and save it.

Published by

Mick Genie

Mick Genie is the founder of MickGenie.com and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.