500 internal error server on post publish or update
-
Hi,
I keep getting a 500 internal error server whenever I pulish or update a post, and on any language since I’m using WPML.
Please advise. Thanks.
The page I need help with: [log in to see the link]
-
Please enable debug mode in WP – https://codex.wordpress.org/Debugging_in_WordPress and all errors will be logged in wp-content/debug.log. Send snippet from this file when 500 error is occurred.
Also, you can find error in php error_log (without enabling debugging), but you need to check more details with your host (you can try to find error_log in home directory, public_html or public_html/wp-admin).+1 the same issue here.
Apologies for getting into the thread, but I send you my debug.log for the same issue: https://imgur.com/a/haWLKIv
500 internal error server is related to the row:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes) in ...
It seems that you need to increase php memory_limit in php.ini ( 256MB = 268435456 bytes ) or add constantWP_MAX_MEMORY_LIMITinto wp-config.php (it increases memory_limit only in wp-admin) – Increasing memory allocated to PHP.I don’t think so, since wp-config.php and php.ini have 256Mb already. Maybe a .htaccess conflict?
-
This reply was modified 7 years, 4 months ago by
fightingcode.
If there isn’t
.htaccessthen you will notice more issues. It’s possible that you have installed nginx, rules in server configuration or.htaccessis hidden (it’s often case in cpanel).
Error message is clear – Allowed memory size of 268435456 bytes ( 256MB ) exhausted. PHP can’t allocate more memory (only 64 bytes in this case) and PHP process is crashed. You can try to increase little memory_limit and test. It’s possible that WPML in combination with other “heavy” plugins require more than 256MB for admin tasks.I increased to 512Mb and post-new.php is working back again. Thanks for your help!
Hi,
Below is the error I’m getting copied from debug.log . But I’m not so sure if the below is responsible for the internal server error.
Also this is a screenshot of the error page I’m getting.
[22-Jan-2019 19:02:25 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 ‘%l\’organisation%’) OR (wp_posts.post_excerpt LIKE ‘%l\’organisation%’) OR (wp_p’ at line 3 for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts LEFT JOIN wp_icl_translations wpml_translations
ON wp_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT(‘post_’, wp_posts.post_type) LEFT JOIN wp_postmeta AS pb_meta ON wp_posts.ID = pb_meta.post_id WHERE 1=1 AND wp_posts.ID NOT IN (38529,44687,44683,44679,46000,42290,42293,29882,36366,1632,1050,53829,53847,1038,790,57539,58306,58725,58724,59632,59634,59635,59677,59688,59689,1627,1477,41452,1051,52199,59163,59165,59162,59164,1467,54846,54845,1468,54839,54838,2005,1625,1052,34094,34088,59160,34091,14109,62110,62112,62113) AND (((wp_posts.post_title LIKE ‘%Cherche%’) OR (pb_meta.meta_value LIKE ‘%Cherche%’) OR (wp_posts.post_excerpt LIKE ‘%Cherche%’) OR (wp_posts.post_content LIKE ‘%Cherche%’)) AND ((wp_posts.post_title LIKE ‘%l\’) OR (pb_meta.meta_value LIKE ‘%l\’organisation%’) OR (wp_posts.post_excerpt LIKE ‘%l\’organisation%’) OR (wp_posts.post_content LIKE ‘%l\’organisation%’)) AND ((wp_posts.post_title LIKE ‘%du%’) OR (pb_meta.meta_value LIKE ‘%du%’) OR (wp_posts.post_excerpt LIKE ‘%du%’) OR (wp_posts.post_content LIKE ‘%du%’)) AND ((wp_posts.post_title LIKE ‘%CIC%’) OR (pb_meta.meta_value LIKE ‘%CIC%’) OR (wp_posts.post_excerpt LIKE ‘%CIC%’) OR (wp_posts.post_content LIKE ‘%CIC%’))) AND (wp_posts.post_password = ”) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘sdm_downloads’, ‘portfolio’, ‘documentation’) AND (wp_posts.post_status = ‘publish’) AND ( ( ( wpml_translations.language_code = ‘en’ OR 0 ) AND wp_posts.post_type IN (‘post’,’page’,’attachment’,’mc4wp-form’,’portfolio’,’documentation’ ) ) OR wp_posts.post_type NOT IN (‘post’,’page’,’attachment’,’mc4wp-form’,’portfolio’,’documentation’ ) ) AND wp_posts.id NOT IN (SELECT post_id FROM wp_wpfront_ure_post_type_permissions WHERE role IN (‘wpfront-guest-role-1’) AND enable_permissions = 1 AND has_read = 0 GROUP BY post_id HAVING COUNT(*) = 1) AND wp_posts.id NOT IN (SELECT post_id FROM wp_wpfront_ure_post_type_permissions WHERE role IN (‘wpfront-guest-role-1’) AND enable_permissions = 1 AND has_read = 0 GROUP BY post_id HAVING COUNT(*) = 1) AND wp_posts.id NOT IN (SELECT post_id FROM wp_wpfront_ure_post_type_permissions WHERE role IN (‘wpfront-guest-role-1’) AND enable_permissions = 1 AND has_read = 0 GROUP BY post_id HAVING COUNT(*) = 1) AND wp_posts.id NOT IN (SELECT post_id FROM wp_wpfront_ure_post_type_permissions WHERE role IN (‘wpfront-guest-role-1’) AND enable_permissions = 1 AND has_read = 0 GROUP BY post_id HAVING COUNT(*) = 1) AND wp_posts.id NOT IN (SELECT post_id FROM wp_wpfront_ure_post_type_permissions WHERE role IN (‘wpfront-guest-role-1’) AND enable_permissions = 1 AND has_read = 0 GROUP BY post_id HAVING COUNT(*) = 1) ORDER BY (CASE WHEN wp_posts.post_title LIKE ‘%Cherche l\’organisation du CIC %’ THEN 1 WHEN wp_posts.post_title LIKE ‘%Cherche%’ AND wp_posts.post_title LIKE ‘%l\’organisation%’ AND wp_posts.post_title LIKE ‘%du%’ AND wp_posts.post_title LIKE ‘%CIC%’ THEN 2 WHEN wp_posts.post_title LIKE ‘%Cherche%’ OR wp_posts.post_title LIKE ‘%l\’organisation%’ OR wp_posts.post_title LIKE ‘%du%’ OR wp_posts.post_title LIKE ‘%CIC%’ THEN 3 WHEN wp_posts.post_excerpt LIKE ‘%Cherche l\’organisation du CIC %’ THEN 4 WHEN wp_posts.post_content LIKE ‘%Cherche l\’organisation du CIC %’ THEN 5 ELSE 6 END), wp_posts.post_date DESC LIMIT 0, 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_postsI think that SQL error isn’t related to 500 error. SQL error is probably related to WPFront User Role Editor and WPML plugins (and maybe search query with apostrophe). Do you see more errors? Did you set
WP_DEBUGandWP_DEBUG_LOGto true?Yes, I did set them both to true.
Below are extra lines from the file debug.log .
[22-Jan-2019 23:39:00 UTC] Ping skipped: previous XML Sitemap was sent to Bing less than 3600 seconds ago.
[22-Jan-2019 23:39:01 UTC] Ping skipped: previous News Sitemap was sent to Google less than 300 seconds ago.
[22-Jan-2019 23:39:01 UTC] Ping skipped: previous XML Sitemap was sent to Google less than 3600 seconds ago.
[22-Jan-2019 23:39:01 UTC] Ping skipped: previous XML Sitemap was sent to Bing less than 3600 seconds ago.Any update?
I’ve posted some extra lines above after enabling WP_DEBUG and WP_DEBUG_LOGYou should see Fatal error: … in debug.log if 500 internal error server is occurred. Ping skipped is just a notice related to sitemap’s plugin.
Second possibility is timeout issue (or other server limit) and it’s usually not logged in PHP error_log (debug.log). You should check server logs (nginx or apache) and cloudflare logs (it seems that your website is behind cloudflare). You can see how to bypass cloudflare – https://www.wpjeos.no/wordpress-admin-cloudflare/. It’s possible to edit local hosts file and bypass cloudflare only for your computer.Below is the log provided by the host server support when I asked them to check the server logs.
[Tue Jan 29 07:07:17.867322 2019] [core:error] [pid 3621] (70007)The timeout specified has expired: [client 24.37.125.210:0] AH00574: ap_content_length_filter: apr_bucket_read() failed
Please check and advise.
Thanks.
-
This reply was modified 7 years, 4 months ago by
LaitP.
Please first check is it related to publish/edit post. Is it similar time? Check does referer: (it should be in the line which you sent) contain post.php?
I think that’s related to Virtual Host (or global) settings in apache (core:error) and probably PHP max_execution_time doesn’t affect to it. Maybe it’s possible to increase value of
FcgidConnectTimeout(if fastcgi is php handler orTimeout,KeepAliveTimeOutwhich are more generic options), but it depends on your hosting. It’s possible that you have reached limits of your hosting (if it’s shared hosting). I’ve found similar error – https://www.cloudlinux.com/forum/forum11/ap-content-length-filter-apr-bucket-read-failed. You could try to get more details from your host.WPSC could clear entire cache if option “Clear all cache files when a post or page is published or updated.” is checked (Advanced tab). It could be extensive operation and it could take some time. Please uncheck this option (for test) if it’s checked. Did you try “Delete cache” (WPSC settings/Contents tab)? Is it working without error? Could you try to update post after clearing entire cache (is it same)?
The “refer:” part contains plugins.php
The “Clear all cache files when a post or page is published or updated.” was not checked actually.
Deleting cache works fine.
-
This reply was modified 7 years, 4 months ago by
LaitP.
-
This reply was modified 7 years, 4 months ago by
The topic ‘500 internal error server on post publish or update’ is closed to new replies.