PHPMyAdmin runs with wrong PHP version

Discussion in 'ISPConfig 3 Priority Support' started by Abacop, Nov 9, 2021.

  1. Abacop

    Abacop Member HowtoForge Supporter

    Since my PHPMyAdmin stopped working in my ISPConfig (3.2.7p1; multiserver environment) I set up a phpinfo in the phpmyadmin folder and found out that it tries to run with php 8.0 (while it should be php 7.3).

    I can't figure out, why this is happening.

    Output of php -v:
    PHP 7.4.25 (cli) (built: Nov 1 2021 20:07:52) ( NTS )

    Output of php-cgi -v:
    PHP 7.4.25 (cgi-fcgi) (built: Nov 1 2021 20:07:52)

    Settings in ISPConfig as in the screenshots below.

    PHP version of /usr/share/phpmyadmin/
    Screenshot-phpinfo-in-phpmyadmin-folder.png

    PHP settings:
    Screenshot-ISPConfig-php-settings.png

    FastCGI settings:
    Screenshot-ISPConfig-fastcgi-settings.png
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Might be that there is a php-fpm.sock alternative that needs to be switched to the right PHP version. Please try this command:

    Code:
    update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock
    I used PHP 7.4 in the command as your current system PHP seems to be 7.4 (you can use PHP 7.3 too if it's installed). If it does not return an error, then restart the web server.
     
  3. Abacop

    Abacop Member HowtoForge Supporter

    Thanks for the quick response. Unfortunately it doesn't solve the problem. Still stuck with PHP 8.

    update-alternatives --config php
    Code:
    There are 8 choices for the alternative php (providing /usr/bin/php).
    
      Selection    Path                  Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/php.default   100       auto mode
      1            /usr/bin/php.default   100       manual mode
      2            /usr/bin/php5.6        56        manual mode
      3            /usr/bin/php7.0        70        manual mode
      4            /usr/bin/php7.1        71        manual mode
      5            /usr/bin/php7.2        72        manual mode
      6            /usr/bin/php7.3        73        manual mode
    * 7            /usr/bin/php7.4        74        manual mode
      8            /usr/bin/php8.0        80        manual mode

    update-alternatives --config php-cgi
    Code:
    There are 7 choices for the alternative php-cgi (providing /usr/bin/php-cgi).
    
      Selection    Path                 Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/php-cgi8.0   80        auto mode
      1            /usr/bin/php-cgi5.6   56        manual mode
      2            /usr/bin/php-cgi7.0   70        manual mode
      3            /usr/bin/php-cgi7.1   71        manual mode
      4            /usr/bin/php-cgi7.2   72        manual mode
      5            /usr/bin/php-cgi7.3   73        manual mode
    * 6            /usr/bin/php-cgi7.4   74        manual mode
      7            /usr/bin/php-cgi8.0   80        manual mode
     
  4. Abacop

    Abacop Member HowtoForge Supporter

    Just to be sure: I'm making all these changes for the webserver (that also runs its phpmyadmin) and not for the panel server, right?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    What you posted are the alternatives for cli and cgi / fcgi php. What your server is using is php-fpm according to the php-info file. Try the command:

    Code:
    update-alternatives --config php-fpm.sock
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The server where this phpmyadmin instance is installed.
     
  7. Abacop

    Abacop Member HowtoForge Supporter

    update-alternatives --config php-fpm.sock
    Code:
    There are 6 choices for the alternative php-fpm.sock (providing /run/php/php-fpm.sock).
    
      Selection    Path                      Priority   Status
    ------------------------------------------------------------
      0            /run/php/php8.0-fpm.sock   80        auto mode
      1            /run/php/php5.6-fpm.sock   56        manual mode
      2            /run/php/php7.0-fpm.sock   70        manual mode
      3            /run/php/php7.2-fpm.sock   72        manual mode
    * 4            /run/php/php7.3-fpm.sock   73        manual mode
      5            /run/php/php7.4-fpm.sock   74        manual mode
      6            /run/php/php8.0-fpm.sock   80        manual mode
    
     
  8. Abacop

    Abacop Member HowtoForge Supporter

    Info: I changed everything to PHP 7.3 since that's what is configured in ISPConfig, too.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the version seems to be fine in that place. Did you restart the webserver after the change?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    If a web server restart does not help, you might try this:

    Code:
    a2disconf php8.0-fpm
    a2enconf php7.3-fpm
    
    and then restart the web server again.
     
  11. Abacop

    Abacop Member HowtoForge Supporter

    Code:
    a2disconf php8.0-fpm
    did the trick.

    Last question: Does this have any effect on my clients that use PHP 8.0?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    No. That's just the global php-fpm process that runs as www-data.
     
  13. Abacop

    Abacop Member HowtoForge Supporter

    Ok. Thanks a lot.
     

Share This Page