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.
if [ “$LIMITUSER” != “root” ]; then
Then modify the ulimit “-m 200000” to “-m unlimited” and save it.