I have a cPanel Hybrid VPS below are the specs:

  • CPU (16 Core Xeon) dedicated
  • 4GB Guaranteed RAM (dedicated)
  • 6GB Burstable RAM
  • 1Gbps Port Speed

Installed cPanel and NginxCP

All sites on server using wordpress are not loading showing below error message

Fatal error: Out of memory (allocated 3407872) (tried to allocate 3200 bytes) in /home/*/public_html/wp-includes/........

Steps done trying to resolve the issue.

  • Upgrading memory_limit to 128M and 256M in PHP Configuration
  • Upgrading memory in wp-config.php
  • Uploaded wordpress files manually via FTP
  • Removed NginxCP and Nginx from server

None of the above solutions worked.

1 Answer 1


Wordpress has a fixed memory limit that overwrites the one defined in php.ini (if allowed by PHP configuration).

In my experience setting a new memory limit on wp-config.php does not overwrite the memory limit set by wordpress itself (even though by glancing at the code it should have been working properly).

So I generally modify wp-includes/default-constants.php and manually set the max memory limit.

Other that that, uploading the files via FTP or removing nginx have nothing to do with your problem.

Especially nginx/NginxCP which essentially only handle static content and do not process any PHP request. It doesn't make any difference whatsoever.

Another approach to this problem would be to optimize or replace the plugin that is memory hungry maxing out the memory limits.

Generally it's better to have optimized code than high limits.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .