• Resolved bond138

    (@bond138)


    Hi

    I’m getting the following memory error only when using PHP version 7 or above.

    PHP version 5.6 does not produce an error.

    I’ve seen this discussed before but not regarding PHP 7 only.

    Scans run fine.

    Wordfence Memory benchmarking utility version 6.3.1.
    This utility tests if your WordPress host respects the maximum memory configured
    in their php.ini file, or if they are using other methods to limit your access to memory.

    –Starting test–
    Current maximum memory configured in php.ini: 512M
    Current memory usage: 38.00M
    Setting max memory to 90M.
    Starting memory benchmark. Seeing an error after this line is not unusual. Read the error carefully
    to determine how much memory your host allows. We have requested 90 megabytes.

    Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 67108872 bytes) in …

    Can you help, thanks?

    WordPress 4.7.2
    Wordfence 6.3.1
    Apache Version 2.4.25

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WFMattR

    (@wfmattr)

    Hi,

    This probably means that your host has set a different limit for their PHP 7 installation than for 5.6. Though the test shows that it’s configured for 512M, there are other ways a host can limit memory that can’t be detected there — if you can tell the host that the memory limit is only 64MB (67108872 bytes) when you run PHP 7, but not when you run PHP 5.6, they should be able to find out where it is set.

    -Matt R

    Thread Starter bond138

    (@bond138)

    Thanks Matt

    I passed the information on to my host.

    They have said the server is set correctly to 512MB, they have now set it to -1.

    To be honest I have had this issue with another host.

    They are asking if you have tested PHP 7 yourself on CloudLinux/CageFS?

    I’ve also noticed that the Wordfence System Info for PHP is misreporting the available memory as 128M (local) -1 (master).

    phpinfo on the server reports -1 for both local and master.

    Could this be an issue with Wordfence misreporting the memory available?

    Thanks

    Peter

    • This reply was modified 9 years, 3 months ago by bond138. Reason: Added additional infomation on PHP system info
    Plugin Author WFMattR

    (@wfmattr)

    Hi,

    Sorry for the late reply. Is this issue still ongoing? We do test on PHP 7, but not on CloudLinux specifically. Since scans are running fine, it looks like this is a side effect of the way the test is written. We do have a case open to update that in a future version, but I don’t have an estimate of when that will be yet.

    -Matt R

    Thread Starter bond138

    (@bond138)

    Thanks for getting back to me Matt.

    I have changed host again since my last post.

    I experienced the same issue but this time technical support knew what to do. At my new host the memory limit was set to 32MB, possibly by default in –

    PHP Configuration File (php.ini): /opt/cpanel/ea-php71/root/etc/php.ini

    This seemed to override the local setting, which is something you suggested in your earlier post. It’s all working now, thank you.

    Regards

    Peter

    Plugin Author WFMattR

    (@wfmattr)

    Great, glad to hear it’s working normally at the new host!

    -Matt R

    Hi,

    I am experiencing exactly the same issue –which I have tested in 4 different installations– but in my case I manage my own VPS so regarding what @bond138 said:

    this time technical support knew what to do. At my new host the memory limit was set to 32MB, possibly by default in –

    PHP Configuration File (php.ini): /opt/cpanel/ea-php71/root/etc/php.ini

    I can asure that in my case, the equivalent file, (/opt/plesk/php/7.0/etc/php.ini, you can take a look here) does not seem to have any directive that could be explaining this error, neither I have overridden those directives on a per domain/installation basis.

    Also, playing with the options WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT in the wp-config.php file did not take any effect.

    Please notice that in @bond138’s case when he managed to get it solved, it was being used PHP version 7.1, whereas I am using PHP version 7.0, in case it may be related to any kind of incompatibility with your code (the one that performs the “Test your WordPress host’s available memory”).

    Thanks!

    Diego

    • This reply was modified 9 years, 1 month ago by diegocanal.
    • This reply was modified 9 years, 1 month ago by diegocanal.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘PHP 7 Only – Memory Error’ is closed to new replies.