-2

I am using CentOS 6; Apache 2.2.2; MySQL 5.6; PHP 5.5.31; WordPress 3.8.13 . I do not have root access to this server because it is shared. I do have FTP and SSH (with some limits to functionality).

Within the last 3 days after adding in an agency's custom Facebook Pixel onto the header file, I have been encountering constant memory overages resulting in the site showing Fatal Error: Out of Memory. It might not have anything to do with the code snippet and just happened to occur near the same time. To alleviate the issue, I increased the PHP.ini from 100m to 400m to support the functionality and increased viewership. I was still encountering out of memory errors, but at least it wasn't showing it on the site (as far as I could see).

The error log shows this:

[Fri Apr 15 11:56:23 2016] [error] [client 00.001.001.001] out of memory
[Fri Apr 15 11:56:23 2016] [error] [client 00.001.001.001] Premature end of script headers: php-latest
[Fri Apr 15 11:56:38 2016] [error] [client 00.001.001.002] client denied by server configuration: /home/79930/domains/domain.com/html/xmlrpc.php, referer: http://domain.careers.com/index.cfm?fuseaction=512576.viewjobdetail&CID=512576&JID=529884
[Fri Apr 15 11:57:56 2016] [error] [client 00.001.001.003] (12)Cannot allocate memory: couldn't spawn child process: /etc/apache2/gs-bin/php-latest, referer: http://domain.com/careers/
[Fri Apr 15 11:57:56 2016] [error] [client 00.001.001.004] unable to init Zlib: deflateInit2 returned -4: URL /gs-bin/php-latest/index.php, referer: http://domain.com/careers/
[Fri Apr 15 11:58:34 2016] [error] [client 00.001.001.005] Out of memory, referer: http://domain.com/locations/eldersburg-commons/
[Fri Apr 15 11:58:39 2016] [error] [client 00.001.001.005] unable to init Zlib: deflateInit2 returned -4: URL /gs-bin/php-latest/index.php, referer: http://domain.com/locations/eldersburg-commons/
[Fri Apr 15 11:58:43 2016] [error] [client 00.001.001.005] Premature end of script headers: php-latest, referer: http://domain.com/locations/eldersburg-commons/

There may be one error once an hour. Still needed to fix it. Next, I looked at the PHP error logs and it was showing:

PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method wf_gmp::init() should not be called statically in /mnt/12345/domains/domain.com/html/wp-includes/plugin.php on line 429
PHP Strict Standards:  Non-static method wf_gmp::add_shortcodes() should not be called statically in /mnt/12345/domains/domain.com/html/wp-content/plugins/5sec-google-maps-pro/5sec-gmaps-pro.php on line 74
PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method wf_gmp::enqueue_scripts() should not be called statically in /mnt/12345/domains/domain.com/html/wp-includes/plugin.php on line 429
PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method wf_gmp::wp_print_styles() should not be called statically in /mnt/12345/domains/domain.com/html/wp-includes/plugin.php on line 429
PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method wf_gmp::init() should not be called statically in /mnt/12345/domains/domain.com/html/wp-includes/plugin.php on line 429

These are minor errors. The last step was that I enabled WP-Debug and it did not show any errors. Sample code below:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);
if (WP_DEBUG) ini_set('display_errors',1);

So, either 1. An Apache or PHP error is not (necessarily) a WordPress error. 2. Or my debug mode seems to be broken. But I've used it before on this site before.

Bonus points for:
How to fix the memory error?
Have you experienced any problems with Facebook Pixel?

  • How will you give us the bonus points? ;) – Tim Malone Apr 25 '16 at 3:26
1

Wordpress errors are application level errors. PHP errors are language syntax or usage errors and appach error are errors detected during the web server operation.

Errors, especially minor ones, might be reported "upwards" and look like they are wordpress application errors, or logged downwards and be part of the apache server error log if the applications wants it. In the end of the day, where they are reported is less relevant, the error itself is what matters.

Bonus: FB pixel should cause memory problems only if on a scale of 1-100 the code suckiness is 1000. Memory errors in general indicate bad code. "adding" memory just hides the problem. You need to review your code, understand what is causing it, and solve it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.