Multiple php Versions with ispconfig 3 and Ubuntu 18.04

Discussion in 'Tips/Tricks/Mods' started by gOOvER, Apr 22, 2019.

  1. gOOvER

    gOOvER Member

    Last edited: Apr 22, 2019
    ahrasis and Taleman like this.
  2. ahrasis

    ahrasis Well-Known Member

    I am not so sure that default php7.2 is automatically changed when we installed php7.3, so I think the step to reset to it is unnecessary. In any event ISPConfig will use the default php7. 2 automatically. Good tutorial by the way.
     
  3. gOOvER

    gOOvER Member

    in my installation it was changed to 7.3 So i need to change it back to 7.2
     
    Last edited: Apr 22, 2019
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    At least on Debian installing a PHP version makes it the default. So after installing several versions, the latest to be installed is the default. I believe this is the same on Ubuntu. So it is necessary to update-alternatives to get the original PHP back as default.
     
    gOOvER likes this.
  5. gOOvER

    gOOvER Member

    it's the same on Ubuntu 18.04. Latest PHP Version will be taken as default. :)
     
    Last edited: Apr 22, 2019
  6. ahrasis

    ahrasis Well-Known Member

    So it is confirmed.

    Anyway, I am not sure the necessity of reverting back to php7.2 when you can already use php7.3.

    By the way, what applications in the server might have problems with php7.3 since php for websites is assigned via options in ISPConfig.
     
  7. nhybgtvfr

    nhybgtvfr Active Member

    well, ispconfig will for a start.
    just had it this morning, updates to php7.3 installed, default php automatically changed from 7.2 to 7.3 on the mailserver.
    later I created a new mailbox in ispconfig, then wondered why the change was taking so long to propagate to the mailserver, found this in /var/www/ispconfig/cron.log on the mailserver.


    Code:
    Wed Apr 24 12:55:01 BST 2019 PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_init() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:78
    Wed Apr 24 12:55:01 BST 2019 Stack trace:
    Wed Apr 24 12:55:01 BST 2019 #0 /usr/local/ispconfig/server/lib/app.inc.php(46): db->__construct()
    Wed Apr 24 12:55:01 BST 2019 24.04.2019-12:55 - WARNING - There is already a lockfile set, but no process running with this pid (2347). Continuing.
    Wed Apr 24 12:55:01 BST 2019 PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_init() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:78
    Wed Apr 24 12:55:01 BST 2019 Stack trace:
    Wed Apr 24 12:55:01 BST 2019 #1 /usr/local/ispconfig/server/lib/app.inc.php(208): app->__construct()
    Wed Apr 24 12:55:01 BST 2019 #2 /usr/local/ispconfig/server/cron.php(53): require('/usr/local/ispc...')
    Wed Apr 24 12:55:01 BST 2019 #3 {main}
    Wed Apr 24 12:55:01 BST 2019 thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 78
    Wed Apr 24 12:55:01 BST 2019 #0 /usr/local/ispconfig/server/lib/app.inc.php(46): db->__construct()
    Wed Apr 24 12:55:01 BST 2019 #1 /usr/local/ispconfig/server/lib/app.inc.php(208): app->__construct()
    Wed Apr 24 12:55:01 BST 2019 #2 /usr/local/ispconfig/server/server.php(51): require('/usr/local/ispc...')
    Wed Apr 24 12:55:01 BST 2019 #3 {main}
    Wed Apr 24 12:55:01 BST 2019 thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 78
    Wed Apr 24 12:55:01 BST 2019 PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_init() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:78
    Wed Apr 24 12:55:01 BST 2019 Stack trace:
    Wed Apr 24 12:55:01 BST 2019 #0 /usr/local/ispconfig/server/lib/app.inc.php(46): db->__construct()
    Wed Apr 24 12:55:01 BST 2019 #1 /usr/local/ispconfig/server/lib/app.inc.php(208): app->__construct()
    Wed Apr 24 12:55:01 BST 2019 #2 /usr/local/ispconfig/security/check.php(32): require('/usr/local/ispc...')
    Wed Apr 24 12:55:01 BST 2019 #3 {main}
    Wed Apr 24 12:55:01 BST 2019 thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 78

    changed php back to 7.2 using update-alternatives and it all started working again.
     
    Last edited: Apr 24, 2019
  8. ahrasis

    ahrasis Well-Known Member

  9. Chris_UK

    Chris_UK Member HowtoForge Supporter

    I'm here due to an upgrade to 18.04 which upgraded PHP also. Not bad as I was thinking about it anyway. However, I noted the same issues and it took some digging to figure it out. Inface if it had not been for an available update to ISPConfig I am sure I would have struggled to track down why server changes were starting to stack up in the job list.

    I found assistance that said install php-mysql as its version independent but didnt help as it was already the latest version and I think that was for another distro anyway. This did lead me to installing php7.2-mysql and then mbstring, I am sure that there will be more extensions to come over the coming days.

    I wonder though, is it possible to have ISPConfig automatically check and install/activate extensions that are active in earlier versions but not in the latest? It would certainly make sense if it could with the default php version being the last installed in many distros.
     
    Last edited: Sep 10, 2019
  10. ahrasis

    ahrasis Well-Known Member

    As far as I know, ISPConfig automatically chooses to use OS shipped php version on install or update for stability, it doesn't check its extensions / modules.

    You may want to set incron to restore shipped php version if latest php7.3 or higher caused problems to your server.

    However, as said before I don't quite believe reverting back to the shipped version is the best solution.

    I would personally prefer to change ISPConfig OS conf file, after extraction but before executing ISPConfig install or update, to use latest php7.3 instead of the shipped version.
     
  11. Jesse Norell

    Jesse Norell Well-Known Member

    This does not answer your actual question, nor speak for or against what @ahrasis said (I no experience there), but to settle yourself on what is required in your current install, you can just refer to the Perfect Server guide for ubuntu 18.04 which you upgraded to, and run the commands to install needed php packages. It is advisable to go through that entire guide and run all the installation commands to ensure you have the needed packages, not just for php.
     

Share This Page