• Hi guys, I recently transferred all my WP files to a new host and everything seemed okay until I started noticing that the desktop site would become narrow as though in a new container although my site is full width. The site loads like normal otherwise just narrower. At the bottom of the page it says there has been a critical error on the site. I cna reload the page a few times and it goes back to normal. I’m not sure what is going wrong and why? I checked my error log and this is what it said:

    PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 2109794 bytes) in /home/(hostingname)/public_html/wp-includes/wp-db.php on line 1168

    Any help would be greatly appreciated. Thanks

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,
    Possible solution is to increase the memory limit on your server to something higher.
    It can be increased in php.ini depends on servers too.

    Following link can also be helpful.
    https://kinsta.com/knowledgebase/wordpress-memory-limit/

    Better solution is to look into the database query you are using to populate things and optimise it. Use indexes.

    Thread Starter HideTheGarlic

    (@hidethegarlic)

    Thanks, The site was working on an old hosting with 512MB of RAM and I’ve just upgraded to 2gb Ram. I might have changed the php.ini in the past, so when that’s transferred over that might make a difference? Is there a way to reset the php.ini file to be the normal settings it should be? Could this also be a plugin issue?

    1. It could be a plugin issue(Tried deactivating some)? Still,
    2. If you 2GB RAM available you need to make sure you are allowing PHP enough to run smoothly.
    3. Check php.ini to make sure.
    4. You can try updating wp_config.php with WP_MEMORY_LIMIT option to see if it solves.
    5. Even if does, you should check you query and try optimising it.

    Bonus: phpinfo() is a function that gives you insight of your server configuration. Use carefully

    Thread Starter HideTheGarlic

    (@hidethegarlic)

    Thank you I’ll have a look into the files. Could updating to PHP 8 help?

    I doubt, this is more of MEMORY than anything else. You are trying to process data that exceeds the allowed limit.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Site Size Error (PHP Fatal error)’ is closed to new replies.