Mass PHP Update

Discussion in 'General' started by Hannes_at, Aug 3, 2023.

  1. Hannes_at

    Hannes_at New Member

    Hi,

    After Ubuntu release update all webs with default php get the new system default php version.
    I need to change this webs back to its old version.
    If i dont want do it over api..
    If i do something like
    sed -i 's/php-cgi/php7.4-cgi'/ in the /var/www/php-fcgi-scripts/xxxxx/.php-fcgi-starter
    should do the thing to set the webs back to the old php version till the user change the php version some day again in the interface.
    Or do i miss some point where the php version is importent to for webs (only fastcgi)?

    Thanks
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    so the ubuntu version has changed.. i take it you've run ispconfig_update.sh.

    the previous default php (7.4) should now be configured as an additional php.. i've always done a clean install on new ubuntu versions, so don't know if the ispconfig_update.sh script does that configuration for you.. you may have to do it manually.
    once done, you should just be able to change the php version for each affected website in the ispconfig interface.

    if you mean for the ispconfig, phpmyadmin, or roundcube, they should all be using the system default.
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This happened only if you set all web site's php to use default.

    Did you have multiple php installed on your server? Find and refer to its tutorial if you are not sure.

    You can do this via ISPConfig UI if you have multiple php installed and set in that UI. Just go to the respective web site's settinhs and change the php version accordingly.

    By default, for web sites, we use php-fpm in ISPConfig now.
     
  4. Hannes_at

    Hannes_at New Member

    some (> 100) user still have the default php from ispconfig (usr/bin/php-cgi) in their webs enabled and this version is changed after every release update from ubuntu/debian (thats why i hide the default php on every new server by default now).
    I only want to prevent to change this 100 webs per hand back to to old version (takes some hours work)
    If i do it with a sed to the .php-fcgi-startup than i only need 5 minutes.
    Think i ll try the sed and if this dont work than i create a api script for this.
    Thanks
     
  5. michelangelo

    michelangelo Active Member

    Why don't you change the PHP version directly in the DB and then trigger a resync of the webs, which will automatically rebuild the vhosts & php confs of the webs?
     
    ahrasis likes this.
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    look in the database. on 3.2.10p2 anyway..
    Code:
    select domain, server_id from web_domain where server_php_id="0";  
    will show all sites, on all servers using the default php.
    if you have more than one server, check the server table to get the server_id for each server;
    then check the server_php table to find the server_php_id for the php version you want for each server_id.

    Code:
    update web_domain set server_php_id="<relevant server_php_id number>" where server_php_id="0" and server_id="<relevant server_id>";
    then resync the websites on that server ( tools -> resync)
    or just
    Code:
    update web_domain set server_php_id="<relevant server_php_id number>" where server_php_id="0";
    if you only have 1 server, then resync the websites.
     
    ahrasis likes this.

Share This Page