Error WordPress Apache VirtualAlloc and VirtualFree, PHP from memory

I am trying to host multiple web pages myself using the Uniform Server WAMP package (Apache version 2.4.20, PHP version 7.0.8), one of them is a simple Bootsrap portfolio, and the other is WordPress , using WooCommerce and other plugins.

From time to time, my WordPress site stops working until I restart the Apache service. I find the main Apache log filled with these errors:

VirtualAlloc () error: [0x00000008] There is not enough memory to process this command. VirtualFree () error: [0x000001e7] An attempt was made to access an invalid address.

And my Apache error logs populated by them:

[Tue Aug 23 14: 49: 59.357235 2016] [: error] [pid 11300: tid 1768] [client 88.119.96.56∗2269] PHP Fatal error: out of memory (allocated 2097152) (tried to allocate 4096 bytes) in D: \ Software \ UniServerZ \ vhosts \ *** \ wp-includes \ pomo \ mo.php on line 276, referent: http: //***/wp-admin/edit.php? post_type = shop_order

differ from 268, 270 and 276, and in mo.php they look like this:

$entry = new Translation_Entry(); // 268 ... $parts = explode(chr(4), $original); // 270 ... $parts = explode(chr(0), $original); // 276 

All source code can be found here .

In the meantime, my portfolio page is working without problems.

I increased memory_limit in php.ini to 2048 MB, added define('WP_MEMORY_LIMIT', '256M'); and define('WP_MAX_MEMORY_LIMIT', '512M'); in wp-config.php, but at least twice a week my site is inaccessible and writes the messages mentioned above.

My sites do not generate much traffic, the server has 16 GB of RAM and a half-empty 512 GB SSD, please help me understand or find out what causes the problem, because current logs tell me very little.

Update 1

I found an interesting line, primarily due to crashes in VirtualAlloc and VirtualFree:

[Tue Aug 23 21: 02: 40.298272 2016] [: error] [pid 504: tid 1836] [client 191.96.249.54 opin6032] script 'D: /Software/UniServerZ/www/xmlrpc.php' not found or failed to establish

Looks like I was a victim of a hack attempt, turned off xmlprc by adding these lines to the .htaccess file:

 <Files "xmlrpc.php"> Order Allow,Deny Deny from all </Files> 

Hope this helps.

Update 2 - in a few days

It seems that the problem is resolved, from time to time I find that the client is rejected by server configuration errors, but the website no longer works.

Update 3 - in a few weeks

The VirtualAlloc () and VirtualFree () error returned, without any suspicious script requests, the log is just full of the mentioned failures, and there are a bunch of mentioned errors from memory in my store log. Is it possible to somehow make Apache errors more verbose / verbose to find out which command is causing an insufficient storage error or which invalid address was taken to access?

Update 4 - after a few months

After some time of regular use of the site and restarting of Apache, the errors simply stopped from time to time, I suspect that some of the used plugins have been updated, and now the memory does not leak, and everything works until the next error ...

+5
source share
1 answer

Not sure if this can help, as WordPress doesn't use native PHP sessions, but it might be that some plugins use.

My situation: Windows OS, PHP 7.0.6 - 7.0.11
VirtuaAlloc error due to php session use. http://php.net/manual/en/features.sessions.php I removed / replaced all php session_ functions with my own.

How to play: session_start (); parse a large xml file (150 MB or more); execute the same script several times at the same time on the Apache server.

+3
source

All Articles