Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing a fatal error after enabling WPML, resulting in a white screen when trying to edit or add pages. The error is due to the

str_contains()

function, which is undefined in their PHP version 7.4, although WPML requires PHP 7.0 or above.
Solution:
This issue has already been fixed with the latest versions of WPML. Please update our plugins to their latest versions.If the issue is not solved on your site with the latest stable version, 4.6.9, you can try the beta version, 4.6.10.https://wpml.org/download/wpml-multilingual-cms/?section=changelog

**** Always try the beta version on a staging site, not a live site.****

If this solution doesn't look relevant to your situation, please open a new support ticket here.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 9 replies, has 4 voices.

Last updated by Itamar 1 year, 4 months ago.

Assisted by: Itamar.

Author Posts
December 7, 2023 at 7:35 am #15013601

khajaM

We have purchased wpml, and when we enable the plugin we are facing the below error and also the edit and add page getting white screen

Fatal error: Uncaught Error: Call to undefined function str_contains() in /home1/webnournetsa/public_html/old/wp-content/plugins/sitepress-multilingual-cms1/classes/request-handling/wpml-request.class.php:123

December 7, 2023 at 9:51 am #15015207

khajaM

Dear Itamar/Team,

Please we need you to add\send email to i.shoukat@nour.net.sa and mohsinmohammed@nour.net.sa too to receive the emails from WPML support.

December 7, 2023 at 10:21 am #15015537

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our system automatically sends notifications about replies in the forum to the email address registered on your wpml.org account. In your case, it is m.alim@nour.net.sa. I'm sorry, but we cannot send it to other email addresses.

We've just noticed that the path in the error message is /home1/webnournetsa/public_html/old/. Maybe you should consider removing the /old/ folder and checking if this solves the problem.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Regards,
Itamar.

December 7, 2023 at 12:12 pm #15016389

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

In addition to the above, our second-tier supporter asks if you have hidden languages.
Can you please check and unhide them and see if the problem persists?
You can read about hiding language here.

https://wpml.org/documentation/getting-started-guide/language-setup/hiding-languages-on-the-front-end/

This issue might be similar or related to another reported issue you can see here.

https://wpml.org/forums/topic/str_contains-php8-function/

Regards,
Itamar.

December 8, 2023 at 10:14 am #15024371

khajaM

how can we check this the plugin is thronging the error and it makes the website down and we are not able to login dashboard. this is we are trying on old folder its a copy of the main website which is running on root.

And the second problem is in production website which is running on root it shows the black page when we are trying to edit or add new page. this issue is relate WPML as well. this issue is more important then the first one because this is our production website.

December 10, 2023 at 11:17 am #15030931

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

In our forum, we deal with one issue per ticket. In this ticket, we deal with the fatal error issue. This issue is escalated to our second-tier supporters.

Fatal error: Uncaught Error: Call to undefined function str_contains() in /home1/webnournetsa/public_html/old/wp-content/plugins/sitepress-multilingual-cms1/classes/request-handling/wpml-request.class.php:123

You wrote:

how can we check this the plugin is thronging the error and it makes the website down and we are not able to login dashboard. this is we are trying on old folder its a copy of the main website which is running on root.

I'm sorry, but I don't understand what you are saying or asking. In my previous reply, I asked you:

In addition to the above, our second-tier supporter asks if you have hidden languages.
Can you please check and unhide them and see if the problem persists?
You can read about hiding language here.

https://wpml.org/documentation/getting-started-guide/language-setup/hiding-languages-on-the-front-end/


Have you checked if the are hidden languages on your site?

You also wrote:

And the second problem is in production website which is running on root it shows the black page when we are trying to edit or add new page. this issue is relate WPML as well. this issue is more important then the first one because this is our production website.

As mentioned, we deal with one issue per ticket. Please open a new ticket for this second issue.

Thanks,
Itamar.

December 11, 2023 at 12:51 pm #15037093

wernerT-3

I ran into the same issue with str_contains, checking on php.net I see that the str_contains function was added in PHP 8.0.
Unfortunately we still run v7.4 - whereas the minimum requirement for WPML ( https://wpml.org/home/minimum-requirements/ ) state php 7.0

Can this statement be replaced by a more compatible statement?

December 11, 2023 at 1:20 pm #15037537

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

What you wrote is true. Our second-tier supporter also mentioned this.

hidden link

The debug information of your site showed that your server uses PHP version 8.1.26. So this is the reason I didn't mention it to you before. I'm sorry; it was my mistake not to say it. Suppose you are using an older version of WordPress (<5.9) along with an outdated version of PHP(<8), you may face an error. You can read about a similar report in our forum here.

https://wpml.org/forums/topic/str_contains-php8-function/#post-14973899

This issue has been escalated to our developers, and I will notify you once the WPML version with the fix is released.

I appreciate your patience.
Itamar.

December 14, 2023 at 8:14 pm #15068685

wadih

deleted - you may delete this post

January 22, 2024 at 11:08 am #15210785

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This issue has already been fixed with the latest versions of WPML.

Please update our plugins to their latest versions.
I'm closing this ticket. Don't hesitate to contact us again with any WPML issues or questions.

Regards,
Itamar.