4

I have made wordpress pages on divi builder on m localhost and they were working fine without any problem but when i installed divi on my online website its giving me the error Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)

I tried changing the define( 'WP_MEMORY_LIMIT', '40M' ); in both my wp-config and default-constants.php file but its still giving the same error!

This error appears when ever I open my homepage. I searched online for man solutions but still cant find a solution :(

enter image description hereenter image description here

enter image description here

2
  • 1
    WP_MEMORY_LIMIT isn't going to help if a limit is set by your hosting. Contact your host and ask them to increase your memory limit. Commented Nov 20, 2019 at 1:14
  • I thought the problem was from my side, I contacted the hosting support and they fixed it. Thanks!
    – Saif Ali
    Commented Nov 20, 2019 at 19:48

1 Answer 1

10

Add the following at the top of wp-config.php:

ini_set('memory_limit','128M');

Although you should use WP_MEMORY_LIMIT when you can, we see in /wp-includes/default-constants.php that Wordpress doesn't do much more than use ini_set itself. Note: This is just one more thing to try, but you'll likely end up having to have your host fix this issue.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.