Page 1 of 2

[Split] Updating to php7

Posted: Sat Jun 03, 2017 3:52 pm
by Prognatus
Hi,

I'm having the same issue as OP, after upgrading to php 7.0 on my host -
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.
I just finished a(nother) support chat with my host and they said -
We have MySQL 5.6.33, and also mysqli is in php7, which we do support
It should be mysqli_connect, not mysql_connect
But that is really going beyond our scope of support as we do not support development of the software.
You'll need to contact the creators of the software.
My config.php -

Code: Select all

$dbms = 'phpbb\\db\\driver\\mysqli';
So I'm confused as to why I get a mysql connect when config.php use the mysqli driver ...?

Re: Updating to php7

Posted: Sat Jun 03, 2017 5:21 pm
by WelshPaul
Cleared the cache?

Re: Updating to php7

Posted: Sat Jun 03, 2017 6:18 pm
by Prognatus
Yes. Deleted everything under the cache directory, except .htaccess and index.htm

It's not only this phpBB installation that don't work anymore, it's all of them on my server!

Re: Updating to php7

Posted: Sat Jun 03, 2017 6:39 pm
by WelshPaul
Run the following command on your server:

Code: Select all

php -m | grep -i mysql
You should get a result like so:

Code: Select all

mysqli
mysqlnd
pdo_mysql
Do you see mysqli in the result?

Re: Updating to php7

Posted: Sat Jun 03, 2017 6:49 pm
by Prognatus
Smart. I'd do that, except I'm not sure how I do it on this hosted server ... there's no command line. I only have access to cPanel v1.0 [RC] and an FTP client (I use Filezilla).

Edit: I just found this article on my host. I'll investigate it further.

Re: Updating to php7

Posted: Sat Jun 03, 2017 6:57 pm
by WelshPaul
Yes, you need to SSH into your server in order to run the command.

If you do not have root access you can create a php file with the following code:

Code: Select all

<?php
phpinfo();
?>
Search the page, MySQLI should be listed there if it's installed.

Re: Updating to php7

Posted: Sat Jun 03, 2017 8:43 pm
by Prognatus
I made a file with your script in it and it called info.php, then executed it, and it revealed a lot of data with 'mysqli' in it. Not sure if that means it's correctly configured though? See for yourself: http://sq42.net/info.php

Re: Updating to php7

Posted: Sun Jun 04, 2017 9:52 am
by WelshPaul
Yep, looks like mysqli is installed and enabled.

You say that you have this set within your config.php file which is also correct:

Code: Select all

$dbms = 'phpbb\\db\\driver\\mysqli';
Again, you claim to have cleared your cache contents... I'm stumped!

Can you give us a link to the forum that displays the error?

Re: Updating to php7

Posted: Sun Jun 04, 2017 9:55 am
by WelshPaul
You could try creating another file:

Code: Select all

$mysqli_connection = new MySQLi('localhost', 'user', 'pass', 'db');
if ($mysqli_connection->connect_error) {
   echo "Not connected, error: " . $mysqli_connection->connect_error;
}
else
{
   echo "Connected.";
}
Replace 'localhost', 'user', 'pass', 'db' with your database credentials and see if that file is able to connect?

Re: Updating to php7

Posted: Sun Jun 04, 2017 10:00 am
by david63
Prognatus wrote:
Sat Jun 03, 2017 6:18 pm
It's not only this phpBB installation that don't work anymore, it's all of them on my server!
Then you need to be asking your questions of your host - we can probably help with phpBB but this would appear to be a wider issue.

Updating to php7

Posted: Sun Jun 04, 2017 1:18 pm
by Prognatus
WelshPaul wrote:
Sun Jun 04, 2017 9:55 am
You could try creating another file:

Code: Select all

$mysqli_connection = new MySQLi('localhost', 'user', 'pass', 'db');
if ($mysqli_connection->connect_error) {
   echo "Not connected, error: " . $mysqli_connection->connect_error;
}
else
{
   echo "Connected.";
}
Replace 'localhost', 'user', 'pass', 'db' with your database credentials and see if that file is able to connect?
Thanks! I'll try that and see what happens.
david63 wrote:
Sun Jun 04, 2017 10:00 am
Prognatus wrote:
Sat Jun 03, 2017 6:18 pm
It's not only this phpBB installation that don't work anymore, it's all of them on my server!
Then you need to be asking your questions of your host - we can probably help with phpBB but this would appear to be a wider issue.
I asked them, and they said several times to me that it was an issue beyond their support ... Here are excerpts from my chat session with them yesterday:
[...] that is really going beyond our scope of support as we do not support development of the software.
If you need further assistance, I would seek out to the software developers and see if theres changes needed on the configuration side
[...] if you're having issues with the software, we cannot support that software as we didn't create the software.
You'll need to contact the creators of the software.
So I don't know what to do now. Restoring the backup won't work either, since it doesn't work with php 7, so in that case I'd have to ask my host to go back to php 5.3 first and I'm not very keen on doing that.

Re: Updating to php7

Posted: Sun Jun 04, 2017 3:48 pm
by WelshPaul
Try creating that file. This is very likely a host issue and if they won't fix it, change hosts.

Re: Updating to php7

Posted: Sun Jun 04, 2017 7:23 pm
by Prognatus
It says "Connected!" and now I can suddenly access the board too! :)
I don't know what happened between yesterday and now but it suddenly works. Perhaps the server had to propagate something in its infrastructure before the change to php 7 could take effect? Anyhow, it works now and I'm a happy camper!

Thatnk you all so much for your help!

Re: Updating to php7

Posted: Sun Jun 04, 2017 9:42 pm
by sakm
Is the host using some sort of cache like cloadflare or varnish?

Re: [Split] Updating to php7

Posted: Mon Jun 05, 2017 4:32 pm
by Prognatus
I don't know. Could be, but I'm not sure. What I do know is that I deleted the cache on my site and refreshed the page in my browser with Ctrl+F5, so to avoid all cached pages.