Every few pages, the website throws a 500 Internal Server Error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
The information in the debug log is as follows:
PHP Warning: preg_replace(): Compilation failed: quantifier does not follow a repeatable item at offset 2 in /html/wordpress/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-slash-management.php on line 118
When I disable WPML the website works fine. Right now, WPML is disabled.
Thank you for contacting WPML Support. Based on the details you provided, it appears that the Internal Server Error issue may be related to specific plugins or themes on your site. To address this, could you please follow the below steps and see if this resolves your issue:
1. Please take a backup of your site first for safety reasons.
2. Please add the below code in the functions.php file of your theme:
3. Please re-save the permalinks from the Settings >> Permalinks page by pressing the Save Changes button.
4. Please delete all sorts of caches on your site/server cache if any / plugin cache / CDN cache, clear the browser cache, and then see if it resolves the issue afterward.
Thank you for your reply. I have followed the steps outlined in your mail, but the problem with the 500 Internal Server Error persists.
The following errors were found in the debug log:
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 0 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 99
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 1 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 99
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 0 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 163
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 1 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 163
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 5 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 163
[22-May-2024 11:30:58 UTC] PHP Warning: Undefined array key 7 in /html/wordpress/wp-content/plugins/wpml-media-translation/classes/class-wpml-media-attachment-by-url-query.php on line 163
[22-May-2024 11:31:04 UTC] PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /html/wordpress/wp-includes/functions.php on line 7288
[22-May-2024 11:31:04 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /html/wordpress/wp-includes/functions.php on line 2187
[22-May-2024 11:35:59 UTC] PHP Warning: preg_replace(): Compilation failed: quantifier does not follow a repeatable item at offset 2 in /html/wordpress/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-slash-management.php on line 118
Thanks for trying those steps. Could you please follow the below steps and see if this resolves the issue:
1. Please take a backup of your site first for safety reasons.
2. We have recently released WPML 4.6.11, please update it to the latest version. You can update it from Plugins >> Add New page, click the Commercial tab, and then click the “Check for updates” button. Here is the screenshot for more details: https://wpml.org/wp-content/uploads/2020/04/wpml-force-plugin-update-1.png
3. Please go to WPML >> Support >> Troubleshooting page and press the below buttons:
- Clear the cache in WPML
- [Please choose each post type one by one] Synchronize posts taxonomies
- Remove ghost entries from the translation tables
- Synchronize local job ids with ATE jobs
- Synchronize translators and translation managers with ATE
- Assign translation status to duplicated content
- Fix post type assignment for translations
- Set language information
And see if this resolves the issue.
4. If the issue persists, kindly perform the following steps to isolate the cause of the issue:
- Deactivate all plugins except WPML and it’s add-ons.
- Switch to the parent WordPress theme like 2023.
- If the issue is gone, reactivate each plugin one by one to identify the one causing the issue.
Please let me know the results,
Thank you for your cooperation
The topic ‘[Closed] WPML seems to cause an internal server error: PHP Warning: preg_replace(): Comp’ is closed to new replies.