[solved] System phpmyadmin doesn't run as site's PHP version

Discussion in 'Installation/Configuration' started by Dogbreath, Dec 30, 2022.

  1. Dogbreath

    Dogbreath Member

    ISPconfig 3.2.9
    Ubuntu 22.04
    PHP versions 7.4 8.0 8.1 installed from Sury repos.
    phpMyAdmin installed from PMA PPAs [but was originally Ubuntu repo before I started troubleshooting this].
    I have a site example.com.
    This is configured in ISPconfig as PHP 8.0 with FastCGI. The site all works fine, except phpmyadmin. I am pretty sure phpmyadmin worked before the OS upgrade.
    I've spent hours and hours trying to resolve this issue:

    AH01071: Got error 'PHP message: PHP Parse error: syntax error, unexpected 'static' (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 272'

    and now I've finally realised with phpinfo(); that:
    https://example.com/phpmyadmin/test.php shows PHP 7.4
    https://example.com/test.php shows PHP 8.0.

    So is this normal? How to make this run as the site's PHP version?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    PHPMyAdmin is a centrally installed app, it does not run in the site as it's a global alias, so it does not use the site's PHP version and you can not make it using the sites PHP version.
  3. Dogbreath

    Dogbreath Member

    I used update-alternatives to set the default php and php-cgi to 8.0. php -v now says 8.0. Restarted apache2 but still /phpmyadmin shows 7.4, so where else do I need to do this?
    FWIW, /phpmyadmin is running as FPM.
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Change the PHP-FPM config for Apache2:
    a2disconf php7.4-fpm
    a2enconf php8.0-fpm
    ahrasis and Dogbreath like this.
  5. Dogbreath

    Dogbreath Member

    Thanks very much Th0m, that was the fix here.
  6. Afeez Bello

    Afeez Bello New Member

    If you still want to use php7.4

    Try this

    If you're using linux

    Empty the ContainerBuilder.php file

    echo "" > /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php

    Open the ContainerBuilder.php file

    nano /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php

    Then paste this content below in the file.

    https:// pastebin.com /Q5tSiaMR
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Is the post #6 legit? What has symphony got to do with PHPMyAdmin? The to be pasted code is > 1600 lines, who reads all that to see what it actually does?

Share This Page