Updating to php7

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
Sarrene
Registered User
Posts: 79
Joined: Wed Jan 23, 2008 10:20 am
Name: Sarrene Grant
Contact:

Updating to php7

Post by Sarrene »

Good Afternoon,
I was wondering if there is an issue with updating to php 7? I did so on my server and revieve the following 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.


Everything else works fine on our server but phpbb3 with this update.

Thank you,
User avatar
david63
Registered User
Posts: 19701
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Updating to php7

Post by david63 »

mysql is not supported in PHP7 you need to change your config.php file to use mysqli, and purge the cache.
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
Sarrene
Registered User
Posts: 79
Joined: Wed Jan 23, 2008 10:20 am
Name: Sarrene Grant
Contact:

Re: Updating to php7

Post by Sarrene »

Thank you david,
Aye, doing a more broad search I found this topic: viewtopic.php?t=2418856&p=14714656

So going to try that and see what happens. I will post up the results and how (if) i got it fixed!
Sarrene
Registered User
Posts: 79
Joined: Wed Jan 23, 2008 10:20 am
Name: Sarrene Grant
Contact:

Re: Updating to php7

Post by Sarrene »

Hello again,
Yeppers, it was that simple! Lords im getting old and out of touch! Thank you David!

Steps are just as simple as David stated and in the topic above. Everything seems to be working fine now.
- Update to php 7.x
- Open your config.php file (make a backup first)
- Replace the word "mysql" with "mysqli"and upload
- Delete the cache/production directory

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

Re: Updating to php7

Post by canonknipser »

I would switch the steps, so you will have no downtime ;)
  1. Open your config.php file (make a backup first)
  2. Replace the word "mysql" with "mysqli"and upload (mysqli should be active on nearly every php 5.x-installation, you can check it with phpinfo module from acp)
  3. Delete the cache/production directory[/s](can be omitted, because config.php isn't cached in 3.2, only in 3.1, but just to be sure ...)[/i]
  4. Update to php 7.x
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
Jonovicez
Registered User
Posts: 8
Joined: Thu Dec 09, 2010 10:22 am
Location: Stourbridge England
Name: John

Re: Updating to php7

Post by Jonovicez »

Thanks for this method. It has fixed the issue I had updating to php7.2. I wanted to upgrade as support for php5 is ending on 31.12.2018.
It was so easy to change the mysql to mysqli in the config file.
sasforum
Registered User
Posts: 14
Joined: Sat Dec 29, 2018 7:36 pm

Re: Updating to php7

Post by sasforum »

Hello,

I've downloaded the config.php file and it was already written 'msqli'.
I've tried to change to php7.0 and php7.2. Each time I've deleted all the cache (that I downloaded). I also tried without deleting the 2 files .htaccess and index but it didn't work. I always have to go back to Php 5.6.
Can you help me?
User avatar
david63
Registered User
Posts: 19701
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Updating to php7

Post by david63 »

@ sasforum

You would be better starting your own topic as this one is already marked as resolved.
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
sasforum
Registered User
Posts: 14
Joined: Sat Dec 29, 2018 7:36 pm

Re: Updating to php7

Post by sasforum »

This is done.
Thanks.
genshijin
Registered User
Posts: 89
Joined: Fri Nov 09, 2018 2:03 pm
Location: Uk and sometimes Japan
Name: andy duggan
Contact:

Re: Updating to php7

Post by genshijin »

I have the same problem on Bluehost.

Tried uninstalling all extensions, also back to default theme with all others deactivated - php7.0 would not work. Tried replacing all files and still not working. Other open source gallery in subfolder is fine though.
Manually updated .htaccess file - line for php handler to php70 when I changed the php.ini file.

phpBB 3.2.5
Database server: MySQL 5.6.41-84.1
PHP version: 5.6.37 (cannot get phpbb3.2.5 to work using php 7.0 on bluehost - they say it is correct at their end)
Board version: 3.2.5


Just saw this (Apr 6).... will try and see if this does it - works;
mysql is not supported in PHP7 you need to change your config.php file to use mysqli, and purge the cache.
Last edited by genshijin on Sun Apr 07, 2019 5:31 pm, edited 3 times in total.
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52303
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Updating to php7

Post by stevemaury »

Please start your own topic.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
Post Reply

Return to “[3.2.x] Support Forum”