Page 1 of 1

PHP 7 support

Posted: Sun May 19, 2019 8:06 pm
by WHK102
I upgrade php version from my server (CentOS 7) and install php 7 from REMI repository. The Wordpress require upgrade my php, this works wine, other smf (for my clients) works fine, all works fine but phpbb3 sucks:
General Error
SQL ERROR [ mysql4 ]

mysql_connect function does not exist, is mysql extension installed? []

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
The php_mysql module is deprecated for oooold time, now for php 5 and 7 require php_mysqlnd and MySQLi.

From https://php.net/en/mysql_connect :
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information
When phpbb3 support the non deprecated functionality for connect to database without manualy modifications?

Re: PHP 7 support

Posted: Sun May 19, 2019 8:21 pm
by david63
No idea from what you have posted as to which version of phpBB you are referring to but phpBB 3.2.7 is fully compatible with PHP7.2

Re: PHP 7 support

Posted: Sun May 19, 2019 8:34 pm
by canonknipser
david63 wrote:
Sun May 19, 2019 8:21 pm
No idea from what you have posted as to which version of phpBB you are referring to but phpBB 3.2.7 is fully compatible with PHP7.2
David, the issue is when you installed phpBB on a server which was running php 5.x, you could use mysql driver in the config.php from
any phpBB-version because it is still valid in php up to 5.6.
But after upgrading your php version to 7.x, you can't use mysql any longer and you need to edit the config.php manually.
WHK102 wrote:
Sun May 19, 2019 8:06 pm
So, just open your config.php in a good text editor like notepad++ and change the string mysql to mysqli, save, enjoy ;)

Re: PHP 7 support

Posted: Sun May 19, 2019 11:16 pm
by WHK102
Other error when upgrade phpbb:
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 281: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
In my config.php says:

Code: Select all

// Hide all error messages
@define('PHPBB_INSTALLED', true);
@define('PHPBB_ENVIRONMENT', 'production');
@define('DEBUG', false);
@define('DEBUG_EXTRA', false);
error_reporting(0);
But always show error messages.

Change mysql to mysqli works fine. Thanks.

Re: PHP 7 support

Posted: Mon May 20, 2019 1:08 am
by EA117
WHK102 wrote:
Sun May 19, 2019 11:16 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 281: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
This appears to be a symptom of having PHP 7.3.x installed or selected, as discussed in previous topics such as these.

As mentioned earlier, the current release of phpBB only supports up to PHP 7.2.x. There has not yet been a release of phpBB that supports PHP 7.3.x.

Afraid the only option on that is to have your host back off to PHP 7.2.x, so that you can satisfy both WordPress and phpBB at the same time. In many cases this is as simple as a PHP version selection in your hosting control panel; while in other cases your hosting support might have to make the switch for you, or tell you how it can be done.

Re: PHP 7 support

Posted: Mon May 20, 2019 6:28 am
by WelshPaul
EA117 wrote:
Mon May 20, 2019 1:08 am
In many cases this is as simple as a PHP version selection in your hosting control panel; while in other cases your hosting support might have to make the switch for you, or tell you how it can be done.
As the OP mentioned "server (CentOS 7)" they likely have their own VPS or dedicated machine so unless they installed their own control panel or it's a managed VPS/Dedicated machine, neither option is available to them. They will have to manually revert to PHP 7.2.x in order to maintain compatibility.

Re: PHP 7 support

Posted: Mon May 20, 2019 7:44 am
by Mick
WHK102 wrote:
Sun May 19, 2019 11:16 pm
But always show error messages.
Presumably you removed the ‘//‘s from the file? Putting them back will hide the messages.
WHK102 wrote:
Sun May 19, 2019 11:16 pm
Change mysql to mysqli works fine. Thanks.

Re: PHP 7 support

Posted: Thu May 23, 2019 1:37 am
by WHK102
Yes, the code without '//' comments.
Yes, is my dedicated server without cpanel, etc, i manage the server by ssh only and have install php using yum package manager.

Code: Select all

[root@x ~]# uname -a
Linux x 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@x ~]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Apr 24 2019 13:45:48
[root@x ~]# php -v
PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
[root@x ~]# mysql -e 'select @@version;'
+----------------+
| @@version      |
+----------------+
| 5.5.60-MariaDB |
+----------------+