Changing PHP Versions

LondonDragon

Active member
Hi guys,

A quick question and something I have not done before. On my VPS I use WHM for manageming the server.

If I change the PHP version from 5.6 to 7.2 via the GUI the forum stops working, other than chaging it on the Magament software are there any files I need to edit?

Many thanks
 

Brogan

XenForo moderator
Staff member
Changing the version in cPanel is all that's required.

Which version of XF are you running?

You need to ensure XF and any add-ons installed are compatible with 7.2.
 

LondonDragon

Active member
Using Xenforo 1.5 at the moment, and currently planning the migration to 2.1 which is why I was looking into migrating the PHP before hand!
 

Brogan

XenForo moderator
Staff member
You can't run (old versions of) XF 1.5 on PHP 7.2.

You can upload the files for XF2, then switch the PHP version, then run the upgrade.

I literally just finished doing that for a customer 5 minutes ago.
 

LondonDragon

Active member
Still had the Widget Framework installed from long time ago! Disabling that sorted it out.
But my main site CMS software doenst like 7.2 so will have to upgrade that also :( fun and games!

Many thanks for pointing me in the right direction! ;)
 

kotarou

Member
Ijust disabed all add ons, changed the php version and I get a lot of mySqli errors. Do I need to run the upgrade or the same version installer? I'm currently on v2.1.10.
 

Brogan

XenForo moderator
Staff member
What are the errors?

If it's related to MySQLi not being available, the PHP version you have switched to doesn't meet the server requirements.
  • PHP: 5.6 (PHP 7.4 recommended)
  • MySQL: 5.5 (MariaDB / Percona also compatible)
  • PHP extensions: MySQLi, GD (with JPEG support), PCRE, cURL, SPL, SimpleXML, DOM, JSON, iconv, ctype
  • Common PHP functions must not be disabled
 

kotarou

Member
I'm current using php5.2 and I tried to go directly to 7.4

See the errors below:

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

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

Deprecated
: Directive 'allow_url_include' is deprecated in Unknown on line 0
 

kotarou

Member
It's working fine now. It was missing some modules.
Is there a place in Xenforo that displays which php version It is using now?
 
Top