Background of the issue:
I am trying to resolve PHP warnings and a PHP fatal error generated by the WPML plugin. I encountered these issues while using the plugin, and I need assistance in addressing them. Here is the code snippet of the errors:
<code>
"PHP Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php:112#012Stack trace:#012#0 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(112): preg_match('@/menu/main\.ph...', Array)#012#1 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load.php(286): TranslationManagement->__construct()#012#2 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(1694): wpml_load_core_tm()#012#3 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/API/Hooks/class-wpml-api-hooks-factory.php(13): SitePress->get_custom_fields_translation_settings(1)#012#4 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(148): WPML_API_Hooks_Factory->create()#012#5 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(96): WPML_Action_Filter_Loader->run_factory(Object(WPML_API_Hooks_Factory))#012#6 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(80): WPML_Action_Filter_Loader->load_factory(Object(WPML_API_Hooks_Factory))#012#7 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(49): WPML_Action_Filter_Loader->load_factory_or_action('WPML_API_Hooks_...', false)#012#8 /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(267): WPML_Action_Filter_Loader->load(Array)#012#9 /nas/content/live/wp/wp-settings.php(526): include_once('/nas/content/li...')#012#10 /nas/content/live/wp/wp-config.php(76): require_once('/nas/content/li...')#012#11 /nas/content/live/wp/wp-load.php(50): require_once('/nas/content/li...')#012#12 /nas/content/live/wp/wp-admin/admin.php(34): require_once('/nas/content/li...')#012#13 {main}#012 thrown in /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php on line 112","Fri Apr 04 2025 13:18:25 GMT+0200"
"PHP Warning: Undefined property: WP_Error::$taxonomy in /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/redirection/wpml-redirect-by-param.class.php on line 162","Fri Apr 04 2025 12:31:32 GMT+0200"
"PHP Warning: preg_replace(): Compilation failed: missing closing parenthesis at offset 107 in /nas/content/live/wp/wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php on line 442","Fri Apr 04 2025 10:00:18 GMT+0200"
</code>
Symptoms:
The WPML plugin is generating PHP warnings and a PHP fatal error. The specific errors include a TypeError in preg_match, an undefined property in WP_Error, and a compilation failure in preg_replace.
Questions:
Are you able to help with these PHP warnings and fatal error issues?
Thanks for contacting WPML forums support. I'll be glad to help you today.
First of all, sorry for the late reply; it was due to a higher workload.
Please let me know what triggers this error.
Also, I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Preferably to a test site where the problem has been replicated.
Your answer will be private, meaning only you and I can access it.
❌ Please back up your database and website ❌
✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.
✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.
Best regards,
Osama
The topic ‘[Closed] PHP fatal errors and warnings’ is closed to new replies.