Wordfence Memory Limit
-
Hi,
I have a CSV import script running via server cron but Wordfence seams to be causing issues with it. PHP-cli has an unlimited
memory_limit => -1
however with Wordfence enabled, this is restricted to 128MB.I think I’ve tracked it down to line 38 of wordfence.php where you cast the memory limit to an int.
if((int) @ini_get('memory_limit') < 128){ if(strpos(ini_get('disable_functions'), 'ini_set') === false){ @ini_set('memory_limit', '128M'); //Some hosts have ini set at as little as 32 megs. 64 is the min sane amount of memory. } }
In my case, -1 is less than 128, theoretically and and thus Wordfence sets a new limit which in turn actually restricts it.
Should there not be an additional check here to see if the memory_limit is -1 or if the current server api is cli
php_sapi_name() !== 'cli'
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Wordfence Memory Limit’ is closed to new replies.