Issue after installing PHP 7.4

Discussion in 'Installation/Configuration' started by nushara, Apr 9, 2020.

  1. nushara

    nushara New Member

    Hey there this is Mike from Nushara,

    I just added PHP7.4 to my ISP with the ubuntu setup how to. Everything works fine but my Cron is having an issue now.

    This is my log of /var/log/ispconfig/cron.log:
    Code:
    Do 9. Apr 12:42:02 CEST 2020 PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_init() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:83
    Do 9. Apr 12:42:02 CEST 2020 Stack trace:
    Do 9. Apr 12:42:02 CEST 2020 #0 /usr/local/ispconfig/server/lib/app.inc.php(47): db->__construct()
    Do 9. Apr 12:42:02 CEST 2020 #1 /usr/local/ispconfig/server/lib/app.inc.php(232): app->__construct()
    Do 9. Apr 12:42:02 CEST 2020 #2 /usr/local/ispconfig/security/check.php(32): require('/usr/local/ispc...')
    Do 9. Apr 12:42:02 CEST 2020 #3 {main}
    Do 9. Apr 12:42:02 CEST 2020 thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 83
    
    Can anybody help me with this? It looks like I am not able to do changes on ISP or my website since cron is now working at all.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if you accidentally replaced the system PHP with a PHP version that lacks MySQL support. Which tutorial did you use to install that PHP version, there are several tutorials available at howtoforge.
     
  3. nushara

    nushara New Member

    https://www.howtoforge.com/tutorial/how-to-compile-and-install-php-7.4-on-ubuntu-18-04/

    This is the tutorial I followed.

    Looks like this also prevents me from updating my ISP
    Code:
    PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_connect() in /tmp/update_stable.sh.bCI4QSMyCw/ispconfig3_install/install/update.php:240
    Stack trace:
    #0 {main}
      thrown in /tmp/update_stable.sh.bCI4QSMyCw/ispconfig3_install/install/update.php on line 240
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then you must have set a wrong install path or missed some of the configure settings. Please run the command:

    which php

    and post the result.
     
  5. nushara

    nushara New Member

    Thanks for the quick help. Here is my result:
    Code:
    /usr/bin/php
    
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. Please post the result of:

    /usr/bin/php --version

    and

    ls /usr/local/bin/
     
  7. nushara

    nushara New Member

    Code:
    PHP 7.4.4 (cli) (built: Mar 20 2020 13:47:45) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
    
    Code:
    ispconfig_patch  ispconfig_update_from_dev.sh  ispconfig_update.sh  run-getmail.sh
    
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, that's really bad, you completely messed up the system PHP by replacing the main PHP binary. The tutorial instructed you to install PHP 7.4 in /opt/php-7.4/, but you installed it in /usr/bin/ instead.

    You probably have to try to reinstall the original PHP from Ubuntu as described in the perfect server guide to fix the system with:

    sudo apt-get install --reinstall php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-imap php7.2-cli php7.2-cgi php-pear php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php-memcache php-imagick php-gettext php7.2-zip php7.2-mbstring php-soap php7.2-soap
     
  9. nushara

    nushara New Member

    Hmm strange, I thought I would have done that. But looks like I am not.

    I will try to install the 7.2 and get back to you in a Second.
     
  10. nushara

    nushara New Member

    Still, the same issue. Should I restart the server or something? (I am sorry but I am not that much experienced with Linux servers in general)
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Does

    /usr/bin/php --version

    show php 7.2 again now?
     
  12. nushara

    nushara New Member

    Still the same. I also did a server restart

    Code:
    PHP 7.4.4 (cli) (built: Mar 20 2020 13:47:45) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
    
     
    Last edited: Apr 9, 2020
  13. nushara

    nushara New Member

    Do you think this can be solved or is a complete new installation the better option?

    Problem is that my service is running on that server so my website would not be available (which is sad but fine in the end) but also my mail server (postfix) would be reset so all my configurations for SSL and getting my mails not flagged as being spam would also be reset and I would have to do that from scratch. (which was a nightmare for me)

    But if you think it really would be the best option to do so, I would consider doing it. I just need to make sure it really is the best option.
     
  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That
    Code:
    sudo apt-get install --reinstall
    should have replaced the PHP. Did the command complete susccesfully? Any error or warning messages?
     
  15. nushara

    nushara New Member

    Nothing really happened. It was just checking for updates, none has been found.
     
  16. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It should have installed the PHP 7.2 versions. Are you sure you used the --reinstall option?
    Now that I read the man page, it says
    so maybe it does not work now that 7.4 is already installed. Perhaps you have to remove 7.4 and apt-get remove those 7.2 php, and then try installing the default PHP of your OS.
     
  17. nushara

    nushara New Member

    Looks like my mail system is also not working any more because of this which is a big problem for me. I will install ISP from scratch. Hopefully I am able to get my SSL working on my Postfix.

    Thank you for your help everyone. I will report if everything works fine later on.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use the packages from ondrej PPA to install PHP 7.4 as additional PHP version instead of compiling it yourself. Use this Debian tutorial:

    https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/

    and just replace chapter 4 with the following commands:

    Code:
    sudo apt-get update
    sudo apt -y install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get upgrade
     
  19. nushara

    nushara New Member

    Thank you I try this later on.

    I have now set up my server with a fresh installation. Everything seems to work besides my SSL on Postfix.

    Is there any official way to enable SSL certificates and login for it? Last time I just gathered a bunch of tutorials and hacked my way to it.

    Would be great if there is an "official" way to do it. Since I need my mails to have DKIM and the other SSL parameters assigned to it.

    Right now I can't even send mails trough my account with TLS.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    When you followed the perfect server guide, then SSL is enabled already in postfix. If SSL is not enabled, then reread the perfect server guide, you probably missed some steps in the postfix config chapter then.

    If you want to have a Let's encrypt SSL cert in addition to have SSL enabled, use this script:

    https://github.com/ahrasis/LE4ISPC
     

Share This Page