News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF 2.0.x installer cannot detect database support

Started by margarett, April 05, 2016, 05:43:36 AM

Previous topic - Next topic

margarett

SMF 2.0 currently does not support MySQLi, which is the default database engine for PHP 7.x. As a result, you may receive the following error when installing SMF on a MySQLi database:

QuoteCritical Error!
The installer was unable to detect any database support in PHP. Please ask your host to ensure that PHP was compiled with the desired database, or that the proper extension is being loaded.

The Team is working to resolve this issue, but in the meantime, if you receive this error, you need to downgrade your PHP version to 5.6.x and make sure that this version supports MySQL.
If you are getting this error on your local computer (eg, you are using XAMPP or another WAMP/LAMP), please make sure you download a version which uses PHP 5.6.x instead of PHP 7.x
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Hubert1965

Downgrading to an old version is not acceptable!

You posted this info in April 05. Now we have August 09. Four month later! And it is still not possible to install SMF on a new Ubuntu 16.04 server with its standard version of PHP.

Arantor

PHP 5.6 is still fully supported by the PHP project, so there is no reason why downgrading is bad here.

TemplateJuggler

What is the latest info on this issue? Me too would like to use SMF with PHP 7.

Kindred

the latest info is that SMF 2.0.x still does not support php 7.  It will, eventually, but it is not a priority right now.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


TemplateJuggler

I was able to hack the latest installer to work with PHP 7 and MySQLi.
In case anyone needs that I share what I did below.

First, I added mysqli into the install.php.
I just copied over the existing mysql section and changed mysql to mysqli and replaced mysql_get_server_info with smf_db_get_server_info:


'mysqli' => array(
'name' => 'MySQLi',
'version' => '4.0.18',
'version_check' => 'return min(smf_db_get_server_info(), mysqli_get_client_info());',
'supported' => function_exists('mysqli_connect'),
'default_user' => 'mysql.default_user',
'default_password' => 'mysql.default_password',
'default_host' => 'mysql.default_host',
'default_port' => 'mysql.default_port',
'utf8_support' => true,
'utf8_version' => '4.1.0',
'utf8_version_check' => 'return smf_db_get_server_info();',
'utf8_default' => false,
'utf8_required' => false,
'alter_support' => true,
'validate_prefix' => create_function('&$value', '
$value = preg_replace(\'~[^A-Za-z0-9_\$]~\', \'\', $value);
return true;
'),
),


I created a copy of install_2-0.mysql.sql as install_2-0.mysqli.sql

I took tinoest's MySQLi mod and copy the 4 PHP files from it into the installer Sources folder.

Finally, I changed "mysql" in Settings.php to "mysqli"

I saw a deprecated warning, but otherwise 2.0.12 installed and works without any issue so far on PHP 7 using MySQLi.





TemplateJuggler

I think I should clarify: this is only a hack and while it seems to work there is no guarantee, so use at your own risk. I only use this for development / testing purposes, not on production.

vbgamer45

Yeah 7.0 is not that bad minor changes for the most part main thing is just the mysql_ functions gone. In a big project i just replaced with mysqli and worked great. I am thinking about dong the same for SMF 1.1.x
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

It is not recommended to do this...

we have an official patch being worked on, and doing this will prevent you from applying the official (and code tested) patch
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

hollermann

Any News about smf 2 and php 7? My provider is forcing their customers to upgrade to php 7. I did it for my smf installation and it didn't work (critical error, mysql-connect unknown or something like that).

d3vcho

You should change your provider... SMF doesn't provide any dates for upcoming releases.

Regards :)
"Greeting Death as an old friend, they departed this life as equals"

ThisSucks

Quote from: Kindred on December 09, 2016, 11:11:46 AM
the latest info is that SMF 2.0.x still does not support php 7.  It will, eventually, but it is not a priority right now.
Is there a way to fix this or should everyone switch to phpbb? I have PHP 5.5 installed and I'm getting the same message.

Kindred

You would not see that message with php5 or php6. 

Also
Quote from: Kindred on December 10, 2016, 05:47:42 PM

we have an official patch being worked on
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

xXxbigdogxXx

Sorry to do this guys but I am in the needs of this as well.

BUMP

shawnb61

This is a very old thread...

2.0.14+ supports mysqli, php7.0 & php7.1.

Php7.2 is not yet supported.

If you are having an issue, you should start a thread in the 2.0 support board.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp


Advertisement: