2

I have got a clean build (WordPress 3.9.1 running Twenty Fourteen theme).

I've installed WooCommerce plugin and added one product.

The product is a variable product with 65 variations.

When I link all variations and save, there are no issues. But editing any information such as stock quantities or price etc and hitting Update will cause the problem below.

Once I click Update, I am redirected to edit.php (the Posts page) and the changes were not saved. There is no error and everything seems to be running just fine.

Upon removing variations one by one I realised that once there's less than 50, the post updates perfectly.

I've tried increasing memory in PHP.ini, .htaccess, wp-config.php and nothing.

Any ideas at all as I'm absolutely lost on this one.

Many thanks in advance.

Michael

EDIT: In actual fact, you don't have to even attempt to change the properties of the new product. Even just trying to change this as it is will cause this issue.

9
  • Are you getting any errors in your error log?
    – Matthew R.
    Jun 17, 2014 at 15:05
  • Maybe you can help me with this actually? I have set WP_DEBUG to true and turned on WP_DEBUG_LOG: define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); But there's no Debug.log. Am I missing a step? I even created a blank debug.log, placed it in wp-contents directory and went through the process but nothing was saved to it? Thank for all the help so far. Jun 17, 2014 at 15:12
  • If you look in your php.ini file it should give you the php service log location on the server. As for the issue with WP_DEBUG, the debug script needs write access to the wp-content directory to be able to create the log file. Maybe try updating your permissions to allow apache to write to that directory.
    – Matthew R.
    Jun 17, 2014 at 15:15
  • My php.ini file only has the increased memory lines (see below): upload_max_filesize = 64M post_max_size = 64M memory_limit = 64M Jun 17, 2014 at 15:19
  • Are you on a shared host? Usually the log file is located either at /var/log/error_log, /var/log/apache2/error_log, /var/log/httpd/error_log or /var/www/{home_dir}/logs/error_log.
    – Matthew R.
    Jun 17, 2014 at 15:29

4 Answers 4

2

We had a similar issue where we got redirected to the Wordpress posts page (/wp-admin/edit.php) instead of the post being saved. We had this issue only when the content field contained around 7.500 characters or more. Below this count the post got saved without any issues.

After trying several suggestions (even the ones listed here), it turned out there was an issue with the temp folder in PHP. After fixing the temp folder, the issue with saving the posts got solved. We stumbled upon this because when uploading a media file it gave an error message about a missing temp folder. So I guess Wordpress uses the temp folder only when the post is above a certain size (the character count I mentioned).

Hopefully this will help anyone else in the future.

1

I think your problem is with your shared hosting setup. Some shared hosts will add a maximum MySQL query length as a security measure. What is happening is that your host sees a huge query (because of all the variations) and drops the query entirely. Since you are doing smaller queries to add and remove variations, the issue doesn't show itself until you want to update the product as a whole.

The fix to this issue would be to contact your hosting provider and have them increase the MySQL query length to a much larger value. You may be able to adjust this yourself in the admin panel, it is usually marked as a security feature so I would start there. You could also try updating the MySQL config (usually located at /etc/mysql/my.cnf or /etc/my.cnf) file to:

[mysqld]
max_allowed_packet=32M

If you are not able to update the config then you will definitely have to contact your hosting provider.

2
  • Thanks for that. I'm on the commute home at the moment so I'll have to check when I get there. But it sounds about right to me. Thanks for all your help. I'll check with the host and mark this as the answer once it's confirmed. Thanks again. Jun 17, 2014 at 16:59
  • 1
    This solution didn't resolve the issue for me. Any other ideas? Mar 26, 2018 at 22:33
1

For anyone else experiencing similar issues, be sure to check mod security with your host. My post request was flagging as a threat with their system so they turned this feature off.

1

I was looking for an answer to a similar problem and that is why I am posting this post, although several years have passed. I am using Wordpress 5.7.2 and Woocommerce 5.3.0.

First of all, do not limit yourself to diagnosing only at the Wordpress level. It is worth enabling PHP debugging, e.g. by entering lines in php.ini (of course, you can configure it according to your own requirements):

error_reporting = E_ALL & ~ E_NOTICE
error_log = /errors.log
log_errors = On

In my case, the following entries appeared in the debug log:

PHP Warning: PHP Startup: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
PHP Warning: PHP Startup: POST data can't be buffered; all data discarded in Unknown on line 0

I compared the structure of my development environment where everything was working fine. It turned out that there was no temporary directory in the production environment (just /tmp for me). After its creation, everything started working as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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