Advertisement:

Author Topic: SMF 2.0.x installer cannot detect database support  (Read 30300 times)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,762
  • Gender: Male
SMF 2.0.x installer cannot detect database support
« on: April 05, 2016, 05:43:36 AM »
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:

Quote
Critical 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

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

Offline Hubert1965

  • Newbie
  • *
  • Posts: 1
Re: SMF 2.0.x installer cannot detect database support
« Reply #1 on: August 09, 2016, 10:22:24 AM »
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,539
    • Arantor on GitHub
Re: SMF 2.0.x installer cannot detect database support
« Reply #2 on: August 09, 2016, 10:46:14 AM »
PHP 5.6 is still fully supported by the PHP project, so there is no reason why downgrading is bad here.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline TemplateJuggler

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Themes from scratch and theme customization service
Re: SMF 2.0.x installer cannot detect database support
« Reply #3 on: December 09, 2016, 11:06:36 AM »
What is the latest info on this issue? Me too would like to use SMF with PHP 7.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,810
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.x installer cannot detect database support
« Reply #4 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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline TemplateJuggler

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Themes from scratch and theme customization service
Re: SMF 2.0.x installer cannot detect database support
« Reply #5 on: December 09, 2016, 11:19:11 AM »
Ok, thank you.

Offline TemplateJuggler

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Themes from scratch and theme customization service
Re: SMF 2.0.x installer cannot detect database support
« Reply #6 on: December 10, 2016, 11:41:01 AM »
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:


Code: [Select]
'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.





Offline TemplateJuggler

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Themes from scratch and theme customization service
Re: SMF 2.0.x installer cannot detect database support
« Reply #7 on: December 10, 2016, 12:43:46 PM »
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.

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,204
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF 2.0.x installer cannot detect database support
« Reply #8 on: December 10, 2016, 01:15:27 PM »
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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,810
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.x installer cannot detect database support
« Reply #9 on: December 10, 2016, 05:47:42 PM »
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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline hollermann

  • Newbie
  • *
  • Posts: 3
Re: SMF 2.0.x installer cannot detect database support
« Reply #10 on: December 15, 2016, 03:02:53 PM »
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).

Online d3vcho();

  • Localizer
  • SMF Hero
  • *
  • Posts: 2,000
  • Gender: Male
  • Be prepared for hell
    • d3vcho on GitHub
    • @SMF_ES on Twitter
Re: SMF 2.0.x installer cannot detect database support
« Reply #11 on: December 15, 2016, 03:06:33 PM »
You should change your provider... SMF doesn't provide any dates for upcoming releases.

Regards :)
Programmer (noun.)
A person who fixed a problem you don't know you have, in a way you don't understand.


¡Únete al canal IRC de SMF en español! #smf-es en Freenode
Sigue a @SMF_ES en Twitter para enterarte de todas las novedades de SMF

Offline ThisSucks

  • Newbie
  • *
  • Posts: 1
Re: SMF 2.0.x installer cannot detect database support
« Reply #12 on: January 30, 2017, 08:28:20 PM »
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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,810
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.x installer cannot detect database support
« Reply #13 on: January 30, 2017, 08:45:51 PM »
You would not see that message with php5 or php6. 

Also
 

we have an official patch being worked on
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.