XF 2.0 fails upgrade from PHP 5.6 to PHP 7.1

sandnes

Member
Looking for hints, tips, or flat-out instructions...
I have access to MultiPHP Manager on my server, and my relatively new XenForo 2.0.10 forum is currently running fine (but SLOW) under PHP 5.6.
When I switch it to PHP 7.1 through my WHM, I get:

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /[]/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 []/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 []/src/XF/Error.php(85): XF\Db\Mysqli\Adapter->getConnection()
#2 []/src/XF/App.php(1942): XF\Error->logException(Object(Error), true, '')
#3 []/src/XF.php(145): XF\App->logException(Object(Error), true)
#4 [internal function]: XF::handleException(Object(Error))
#5 {main} thrown in []/src/XF/Db/Mysqli/Adapter.php on line 152

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in []/src/XF/Db/Mysqli/Adapter.php:152
Stack trace:
#0 []/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 []/src/XF/Error.php(85): XF\Db\Mysqli\Adapter->getConnection()
#2 []/src/XF/App.php(1942): XF\Error->logException(Object(ErrorException), true, '')
#3 []/src/XF.php(185): XF\App->logException(Object(ErrorException), true)
#4 [internal function]: XF::handleFatalError()
#5 {main} thrown in []/src/XF/Db/Mysqli/Adapter.php on line 152

(Where you see [] I have removed my path folders from above)
--
Any ideas would be greatly appreciated!
 
Was just thinking about upgrading mine to same...will be watching this.

Not sure what was meant by mysqli_init yet -- researching.
 
It means you're missing the MySQLi PHP extension -- you can run the XF requirements test script, as you might find other bits are missing. That extension will need to be enabled in the selected PHP version (however you do that with your given OS/management package).
 
I haven't tried enabling mysqli_init yet (probably need to contact my host provider since I haven't found out how to do that myself) but in my case, running the requirements script returns this:
Requirements met
Your server meets all of XenForo's PHP requirements.

And also in PHPMyAdmin I can see this:
Web server
  • cpsrvd 11.74.0.9
  • Database client version: libmysql - 5.1.73
  • PHP extension: mysqli curl mbstring
  • PHP version: 5.6.30
--
So, am I guessing right that when I switch to PHP 7.1, it's THAT version that will give different responses (e.g., not all requirements met, or mysqli not listed under extensions)? (I'm just trying to think ahead, I don't want to try this again until the wee hours.)
 
Yeah you need to run the requirements script with the PHP environment you're actually trying to use. When you switch to a different version, your configuration will be totally different.
 
Back
Top Bottom