Absurdly high memory allocations with php7.4 under apache windows

Viewed 156

What could be the cause of these very unlikely high memory allocations attempts, I notice lately on my production server:

PHP Fatal error: Allowed memory size of 1006632960 bytes exhausted (tried to allocate 51002234388 bytes) in D:\wp\wp-includes\load.php on line 1466 

This happened in Wordpress (see error message), but also in Lime Survey.

I'm running PHP 7.4.27 on Windows Apache 2.4.21 on a Windows Server 2008.

The error is consistent (same number of bytes, same script, same line) and remains after a server restart.

Strangely I could get rid of the error in a Lime Survey installation by simply moving all the script files to a different folder.

Edit: Same now: Downloading via FTP all the script files in D:\wp, creating a new directory D:\wp and uploading all the files fia FTP, the error vanished. What's going on here?

Thank you!

2 Answers

1 - check PHP 7.4 memory limit

(check php.ini -- check folder configuration in the windows)

2 - Insert memory limit in wp-config.php

3- insert the memory limit in .htaccess

4 - Check the plugins.

5 - Possibly have a hidden malicious code file

( 5.1 - look for files with the same name as the folder. Example: FOLDER = theme (when entering the folder) there is a file with the name = .theme.php

5.2 - Analyze your index.php, wp-config.php or .htaccess (if they were not auterated, enter codes)

6 - Analyze the logs

The cause is most likely plugin related.

I would check:

  • wordpress error logs
  • php error logs
  • Apache error logs
  • server error logs
  • any pending cron jobs.
  • isolate and debug any plugin DB queries.
  • are there any heavy reports (DB generated)

Isolating which plugin, can be done by using a live backup, and deleting/disabling plugins one at a time.

Increasing the memory limit may be done through wordpress, but may not bite, unless configured on the server or php level.

Related