Reply To: 500 server error

#13893

Ernest Marcinko
Keymaster

Hi again,

The issue does not seem to be related to one specific plugin. It looks like the server was simply running out of memory, and it still does. If I enable Ajax Search Pro, and disable any other plugin (for example Tablepress), then the product edit screen is fixes – meaning that the problem is not directly caused by Ajax Search Pro, or any other of the plugin (very likely). I have left Tablepress de-activated, and ajax search pro active, to demonstrate the problem.

I have turned on error reporting temporarily, and the memory limit was set to 128M, which is very low, and the error messages were reporting a memory exhaust. I have placed the following code to the wp-config.php file to try to fix the issue:

ini_set('memory_limit','256M');

.. but it has no effect. This means that the memory limit cannot be changed via PHP, it has to be set on the server via php.ini or equivalent.
If you disable any plugin, this issue goes away, as sufficient memory remains to run the site. I highly recommend changing the memory limit on the server to 512M and lowering it then, if needed.

The memory limit error appears in the error logs as well, for example:

[07-Jul-2017 13:14:50 UTC] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 2322433 bytes) in /home/elel1545/public_html/wp-includes/functions.php on line 3721

There are also great number of lines in the error-log files, reffering to Tablepress and WooCommerce plguins directly, these errors appeared in the error log:

WooCommerce:

[07-Jul-2017 13:14:48 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 6 for query SELECT postmeta.post_id AS product_id
FROM elitefrozen_postmeta AS postmeta
LEFT JOIN elitefrozen_posts AS products ON ( products.ID = postmeta.post_id )
WHERE postmeta.meta_key LIKE 'attribute_%'
AND postmeta.meta_value = 'australia'
AND products.post_parent =  made by include('wp-admin/edit-form-advanced.php'), do_meta_boxes, call_user_func, WC_Meta_Box_Product_Data::output, include('/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-panel.php'), WC_Meta_Box_Product_Data::output_variations, include('/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php'), apply_filters('woocommerce_variation_option_name'), WP_Hook->apply_filters, call_user_func_array, display_price_in_variation_option_name

Tablepress

[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_keys() expects parameter 1 to be array, null given in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 228
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 229
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_diff() [<a href='function.array-diff'>function.array-diff</a>]: Argument #1 is not an array in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 230
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_keys() expects parameter 1 to be array, null given in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 232
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 233
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_diff() [<a href='function.array-diff'>function.array-diff</a>]: Argument #1 is not an array in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 234
[07-Jul-2017 13:21:38 UTC] PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 234
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 237
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243
[07-Jul-2017 13:21:38 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/elel1545/public_html/wp-content/plugins/tablepress/classes/class-render.php on line 243

These are probably not too serious issues, but I wanted to let you know.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)