PHP 8.2 as the default version of PHP

Discussion in 'Installation/Configuration' started by Marcio Urakawa, Jan 11, 2024.

Tags:
  1. Recently I performed the server upgrade procedure from Debian 11 to Debian 11.


    In the step where I change the default version of PHP to 8.2, several sites crashed and are giving error 503 and I am returning to version 7.4 manually.

    Would this be the best practice?
    OR do I use the update-alternatives --config php command to leave it at version 7.4?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You should follow tutorial to set up multiple php so that can be used for websites. Default php is needed only for your server, but not necessarily need to be the same for websites as they can use other php version from 5.6 to 8.3.
     
    yehanny likes this.
  3. I already use it that way. I was just confused because the sites crashed after updating to 8.2 by default.
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Those websites do not work with PHP 8.2. That happens all the time.
    You need to check what is the latest or best version of PHP each website can work with, and set website to use that.
    As for default version of PHP, it must be what came with OS originally. From the read before posting -article:
    Code:
    These are the default versions that should be used:
    Debian 9: PHP 7.0
    Debian 10: PHP 7.3
    Debian 11: PHP 7.4
    Debian 12: PHP 8.2
    Ubuntu 16.04: PHP 7.0
    Ubuntu 18.04: PHP 7.2
    Ubuntu 20.04: PHP 7.4
    Ubuntu 22.04: PHP 8.1
    CentOS 7: PHP 5.4
    CentOS 8: PHP 7.2
     
    ahrasis and Marcio Urakawa like this.
  5. I am manually checking the sites.
    However, for some reason the vhost does not update.

    Can you tell me where in the database I can adjust this manually?
    In the web_domain table I only see customized configurations.
    Code:
     SetHandler "proxy:unix:/var/lib/php8.2-fpm/web67.sock|fcgi://localhost"
    I need change to:
    Code:
     SetHandler "proxy:unix:/var/lib/php7.4-fpm/web67.sock|fcgi://localhost"
    In the web_domain table I only see customized configurations.
     
  6. I understood what happened. A few days ago I had a problem with the certificate and all sites stopped.

    So I had to move the sites-enabled vhost, however I believe that when I returned the files I just copied some instead of moving them, so the symlinks were lost.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    There is a misunderstanding on your side, you can not even see the PHP version at all in the vhost and the vhost does not change when you change a PHP version.

    The numbers in these lines are not the PHP version used by the site, so they should not change. The number gets chosen when the server is initially installed; they do not represent a PHP version of the site, and they never change on an operating system update.
     
    ahrasis likes this.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    That's bad as it prevents ISPConfig from working. You must delete all files in sites-enabled and replace them with symlinks.
     
    ahrasis and Marcio Urakawa like this.
  9. Thanks for the clarifications.I'm doing this manually.
    Another doubt,
    In this part of Vhost there is a reference to php7.3 using sock in the folder /var/lib/php7.3-fpm/
    However, this is causing problems on some sites due to the conflict of using the same sock.

    Code:
    SetHandler "proxy:unix:/var/lib/php7.3-fpm/web67.sock|fcgi://localhost"
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no reference to PHP 7.3, as I mentioned in my last post, you can not see the PHP version at all in the vhost. The number 7.3 is not the PHP version used by this site, its just the name of the global socket folder that is used by all PHP versions on this server.
     
    ahrasis and Marcio Urakawa like this.
  11. Now I understand. It was clear that it is a global folder.
    I corrected the links and everything went back to normal. Thanks.
     
    Last edited: Jan 11, 2024
    till and ahrasis like this.

Share This Page