MyBB Community Forums

Full Version: PHP 7.2 is causing error on my forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
With the latest version of MyBB 1.8, when setting the PHP version in the hosting configuration to PHP v7.2, we are experiencing the below error message in the web browser upon new user registration, after submitting the details on Page 1, and posting:


Quote:Fatal error: Uncaught Error: Call to undefined function ereg() in /home/admin/public_html/mybb/member.php:184 Stack trace: #0 {main} thrown in /home/admin/public_html/mybb/member.php on line 184



However after changing back to PHP v5.6, everything works fine. What is the problem and can this be resolved?
"Call to undefined function ereg()" is your clue.

It's a deprecated function.

https://www.php.net/manual/en/function.ereg.php

I thought MyBB manually added it though for backward compatibility. What version of MyBB are you running?

You can try to use preg_match(). You'll edit line 184 in member.php.
(2019-10-27, 07:46 PM)stevef Wrote: [ -> ]With the latest version of MyBB 1.8, when setting the PHP version in the hosting configuration to PHP v7.2, we are experiencing the below error message in the web browser upon new user registration, after submitting the details on Page 1, and posting:


Quote:Fatal error: Uncaught Error: Call to undefined function ereg() in /home/admin/public_html/mybb/member.php:184 Stack trace: #0 {main} thrown in /home/admin/public_html/mybb/member.php on line 184



However after changing back to PHP v5.6, everything works fine. What is the problem and can this be resolved?
That function doesn't exist in newer versions of PHP, however, it's not there with a default MyBB install, so my guess is that it's caused by a plugin meant for an older version of PHP. Try checking for a newer version of the plugin or contact the developer. Smile
It is indeed seems to be a plugin issue... I just installed Mybb for my new sites and noticed php error page when activating certain plugins on phph 7.2 and after changing the version back to 5.6 everything works normally.
I think if you needs the plugins (like me) then it is better to stick with 5.6 for now.
(2019-10-28, 07:55 AM)Muti Wrote: [ -> ]It is indeed seems to be a plugin issue... I just installed Mybb for my new sites and noticed php error page when activating certain plugins on phph 7.2 and after changing the version back to 5.6 everything works normally.
I think if you needs the plugins (like me) then it is better to stick with 5.6 for now.
I think that if you need the plugins, it's better to make them working with php 7.2. Contact the developper and notice him that the plugin is incompatible with newer versions of PHP, detailling the encountered errors or warnings.
I just went through this with my forums and found 2 plugins that caused problems with PHP 7.2...

Askimet
PHP and Template Conditionals (2.1)
What makes members think this is a plugin when it's member.php which is called in the error?

Usually if it's a plugin then that file in the inc/plugins/ folder will get displayed.
The latest MyBB does not have these issues. So it must be code or plugin related. Alternatively the OP does not have the latest MyBB installed.
(2019-10-29, 01:50 AM)labrocca Wrote: [ -> ]What makes members think this is a plugin when it's member.php which is called in the error?

Some plugins modify core files when activated, and remove the edit when deactivated.
(2019-10-29, 11:29 AM)HLFadmin Wrote: [ -> ]
(2019-10-29, 01:50 AM)labrocca Wrote: [ -> ]What makes members think this is a plugin when it's member.php which is called in the error?

Some plugins modify core files when activated, and remove the edit when deactivated.
Plugins may NEVER modify core.
Pages: 1 2