MyBB Community Forums

Full Version: MyBB 1.8.14 won't work with PHP 7.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have been told to upgrade my web site to PHP 7.0 as I was running 5.6 and MyBB 1.7.
The upgrade worked fine to 1.8.14 but when using PHP 7.0 I get an error 44 complaining about the SQL extension.
So I have had to go back to 5.6

Any ideas?
in the config.php file change database type to mysqli & then you should be able to use php 7 with MyBB 1.8.14
I'll give it a go... I presume you meant mysql not mysqli?
^ if mysql is used then change to mysqli - NOT vice versa
This is what is in the config.php file:

$config['database']['type'] = 'mysql';
$config['database']['database'] = 'azapeo_forum';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = '___________________';
$config['database']['username'] = '___________________';
$config['database']['password'] = '___________________';

And of course it worked with PHP 5.6
^ mysql extension is removed in php 7

so if you upgrade php to version 7 (or above) then you have to use mysqli

hence you have to change mysql to mysqli in the config.php file

if that doesn't work then your web host should be able to fix it.
$config['database']['type'] = 'mysql';

to

$config['database']['type'] = 'mysqli';

Very subtle, but that's what you have to do.
I don't know if this is any help or not.
I also recently updated from PHP 5 to PHP 7. I was running a script that stopped working after the upgrade. Which what I understand has something to do with PHP and mysql. So a guy came up with a fix and made it work again.
I don't code but this command/setting is shown when I do a diff on the two files

global $conn;
include '../config.php';
// connect here : handle $conn visible througout includes
$conn = new mysqli($CONFIG['dbHost'], $CONFIG['dbUser'], $CON

That was not present in the original files and that $CON is used in almost every file now.
Those files are open source licensed under the GPL. If you wish I could provide you with the links so you can study the code.
Changed the database type to 'mysqli' and all now works! Thanks for your help but how was I to know that otherwise? Seems a bit strange anyway to mis-spell the name of the DB?
^ that is not mis-spelt. mysqli is improved version of mysql
Pages: 1 2