php8 on phpmyadmin

Discussion in 'ISPConfig 3 Priority Support' started by atle, Feb 18, 2021.

  1. atle

    atle Member HowtoForge Supporter

    I have tried out the ISPConfig-autoinstall script to install a web/db server in a multi server environment.
    The script did install php5.6 - php8 and default version has been set to php7.3. Ordinary sites do get php7.3, but /phpmyadmin has got php8, and hence breaks phpmyadmin < 5. https://foo.com/phpinfo.php shows php7.3 but https://foo.com/phpmyadmin/phpinfox.php shows php8.
    Anyone know how do I set php7.3 for /phpmyadmin?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Are you using Apache or nginx?
     
  3. atle

    atle Member HowtoForge Supporter

    Apache.
    And all
    Code:
    update-alternatives --config php
    update-alternatives --config php-cgi
    update-alternatives --config php-fpm.sock
    shows php7.3 as current.
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Code:
    a2dismod php8.0
    a2enmod php7.3
    and then restart apache:
    Code:
    systemctl restart apache2
     
  5. atle

    atle Member HowtoForge Supporter

    Hm,
    Code:
    [email protected]:/etc/apache2# a2enmod php7.3
    ERROR: Module php7.3 does not exist!
     
  6. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Was dismod of php8.0 successful? If so, see if it works now. If you have no default php interpreter at all, try 'a2enconf php7.3-fpm'.
     
  7. atle

    atle Member HowtoForge Supporter

    Nope, there is no php handler when I disabled php8.0 and dismod of php8.0 was successful.
     
  8. atle

    atle Member HowtoForge Supporter

  9. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    What os do you have? I use php7.3-fpm for phpmyadmin on Debian 10.
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    The autoinstaller installs PMA 5+, which support PHP 8 - why are you using a older version?
     
  11. atle

    atle Member HowtoForge Supporter

    Its Debian 10. I have installed web/db servers following the perfect server guide and the manual, and with no multi php, and that works perfect.
    I wanted to try the auto install script to conveniently get the multi php install, which I want. This seems to be the only issue with this script.
     
  12. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just did a autoinstall on Debian 10, which uses PMA 5 and is working fine. So I don't think there's a problem with the script.
     
  13. atle

    atle Member HowtoForge Supporter

    I download the git archive, and what I understand it makes sure it is the latest version of the script.
    Code:
    git clone https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller.git
    cd ispconfig-autoinstaller
    ./ispc3-ai.sh  --interactive --use-ftp-ports=40110-45210 --no-mail --no-dns --no-firewall
     
  14. atle

    atle Member HowtoForge Supporter

    Well, this I can say, it did not :) It did install an old 4.x version that broke totally
    Code:
    [Thu Feb 18 16:46:12.618309 2021] [php:error] [pid 4464] [client *********:52961] PHP Fatal error:  Uncaught Error: Call to a member function getDisplay() on null in /usr/share/phpmyadmin/libraries/classes/Response.php:266\nStack trace:\n#0 /usr/share/phpmyadmin/libraries/classes/Response.php(279): PhpMyAdmin\\Response->_getDisplay()\n#1 /usr/share/phpmyadmin/libraries/classes/Response.php(438): PhpMyAdmin\\Response->_htmlResponse()\n#2 [internal function]: PhpMyAdmin\\Response->response()\n#3 {main}\n  thrown in /usr/share/phpmyadmin/libraries/classes/Response.php on line 266
    [Thu Feb 18 16:46:13.861376 2021] [php:error] [pid 28582] [client **********:52962] PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /usr/share/phpmyadmin/libraries/classes/Url.php on line 251
    I upgraded to 4.9 and was able to login, but still error messages. I have not tried to install 5+. Is that the solution? In that case, if I use the script for the master server, will ISPConfig work with php8, or will it choose a different version?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    No, the default PHP version must remain the one that belongs to the OS version that you use.
     
  16. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Alright. I'm getting somewhere in my testing.

    PHP 8 is used while PHP 7 should be - so this is wrong, I am trying to figure out where this goes wrong.
    EDIT: Discard this: "PMA 4.9 should be installed when I read the code, but for some reason PMA 5 is installed on my brand new system. Still looking into this aswell."

    4.9.5 is installed and does not fully work.

    I'll let you know if I find something.
     
  17. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Possible solution:
    I have Ubuntu 20.04 fresh install with autoinstaller:
    Code:
    [email protected]:/etc/apache2# ls -la /etc/alternatives/*ph*
    lrwxrwxrwx 1 root root 21 Feb 18 19:26 /etc/alternatives/phar -> /usr/bin/phar.default
    lrwxrwxrwx 1 root root 37 Feb 18 19:26 /etc/alternatives/phar.1.gz -> /usr/share/man/man1/phar.default.1.gz
    lrwxrwxrwx 1 root root 26 Feb 18 19:26 /etc/alternatives/phar.phar -> /usr/bin/phar.phar.default
    lrwxrwxrwx 1 root root 42 Feb 18 19:26 /etc/alternatives/phar.phar.1.gz -> /usr/share/man/man1/phar.phar.default.1.gz
    lrwxrwxrwx 1 root root 15 Feb 18 19:37 /etc/alternatives/php -> /usr/bin/php7.4
    lrwxrwxrwx 1 root root 31 Feb 18 19:37 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.4.1.gz
    lrwxrwxrwx 1 root root 19 Feb 18 19:37 /etc/alternatives/php-cgi -> /usr/bin/php-cgi7.4
    lrwxrwxrwx 1 root root 35 Feb 18 19:37 /etc/alternatives/php-cgi.1.gz -> /usr/share/man/man1/php-cgi7.4.1.gz
    lrwxrwxrwx 1 root root 23 Feb 18 19:34 /etc/alternatives/php-cgi-bin -> /usr/lib/cgi-bin/php8.0
    lrwxrwxrwx 1 root root 24 Feb 18 19:39 /etc/alternatives/php-fpm.sock -> /run/php/php7.4-fpm.sock
    Code:
    update-alternatives --config php-cgi-bin
    set PHP 7.4
    (does not resolve this issue but should not be PHP 8. I will open a bug report for this in the GitLab of the autoinstaller)

    Code:
    [email protected]:/etc/apache2# a2dismod php8.0
    Module php8.0 disabled.
    To activate the new configuration, you need to run:
      systemctl restart apache2
    [email protected]:/etc/apache2# a2enmod php7.4
    ERROR: Module php7.4 does not exist!
    This is the solution:
    Code:
    sudo apt install libapache2-mod-php7.4 libapache2-mod-php
    And then restart Apache, just for sure:
    Code:
    systemctl restart apache2
    I will see what's causing this and eventually open a bug report aswell. I will do some testing on Debian 10 later, but as Ubuntu and Debian are much alike, this is most likely the fix for you.
     
    Last edited: Feb 18, 2021
    ahrasis likes this.
  18. atle

    atle Member HowtoForge Supporter

    ahrasis likes this.
  19. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    atle likes this.
  20. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I have fixed this, it should be included in the autoinstaller tomorrow (the releases are build every night).
     
    till likes this.

Share This Page