PHP 7 support

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
WHK102
Registered User
Posts: 9
Joined: Wed Aug 15, 2018 8:40 pm

PHP 7 support

Post by WHK102 » Sun May 19, 2019 8:06 pm

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?

User avatar
david63
Registered User
Posts: 16561
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: PHP 7 support

Post by david63 » 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
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
canonknipser
Registered User
Posts: 2090
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: PHP 7 support

Post by canonknipser » Sun May 19, 2019 8:34 pm

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 ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

WHK102
Registered User
Posts: 9
Joined: Wed Aug 15, 2018 8:40 pm

Re: PHP 7 support

Post by WHK102 » Sun May 19, 2019 11:16 pm

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.

User avatar
EA117
Registered User
Posts: 947
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: PHP 7 support

Post by EA117 » Mon May 20, 2019 1:08 am

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.

User avatar
WelshPaul
Registered User
Posts: 330
Joined: Tue Aug 19, 2014 2:09 pm

Re: PHP 7 support

Post by WelshPaul » Mon May 20, 2019 6:28 am

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.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21586
Joined: Fri Aug 29, 2008 9:49 am
Location: Caerdydd

Re: PHP 7 support

Post by Mick » Mon May 20, 2019 7:44 am

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.
"The more connected we get the more alone we become" - Kyle Broflovski

WHK102
Registered User
Posts: 9
Joined: Wed Aug 15, 2018 8:40 pm

Re: PHP 7 support

Post by WHK102 » Thu May 23, 2019 1:37 am

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 |
+----------------+

Post Reply

Return to “[3.2.x] Support Forum”