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
 
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.
 
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!
 
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.
 
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! ;)
 
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.
 
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
 
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
 
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?
 
ok that didn't work, when I changed it to 7.4 it came up a page that said service unavailable then I switched back to 7.3 and it is fixed again...
 
Is updating from PHP version7.3.33 to 7.4 as simple as just changing the setting in the drop down menu to 7.4 in cpanel or is there more to it?
Thats all you have to do. If you switched to 7.4 and had an error or page wouldn't load then something on your site isn't compatible with 7.4
 
Top Bottom