AutoInstaller ISPConfigOSException PHP Error

Discussion in 'Installation/Configuration' started by Abhishek.kr, Nov 3, 2021.

  1. Abhishek.kr

    Abhishek.kr New Member

    When trying to install a webserver role, getting below error :
    WEB : [ERROR] Exception occured: ISPConfigOSException -> Command update-alternatives --set php-cgi /usr/bin/php-cgi7.4

    As I found same bug was reported earlier and fixed for ISPConfig3.1.
    Now, please fix it too for ISPconfig3.2 which latest installer is available now.

    Thanks!
    Abhishek
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    First of all, this error is not related to ISPConfig 3.1 or 3.2, it is a message from the auto-installer and not from ISPConfig. So whatever you thought was fixed in ISPConfig 3.1, this is not related to it.

    Which command-line options did you use in the auto-installer and which OS do you use?
     
  3. Abhishek.kr

    Abhishek.kr New Member

    I'm using below command line option for installing only a webserver.
    OS is Ubuntu 20.04.3 LTS.
    Thanks!
    Abhishek
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are there any error messages or warnings before the one you showed?
    Is the Ubuntu a clean plain install like the autoinstaller tutorial says it must be?
     
  5. Abhishek.kr

    Abhishek.kr New Member

    >Are there any error messages or warnings before the one you showed?
    No, I didn't notice any such. Here is the complete log for your reference.
    >Is the Ubuntu a clean plain install like the autoinstaller tutorial says it must be?
    Yes, it is a new clean plain Ubuntu machine.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. I'll do a test install with these settings so we can narrow down if it is caused by a change in Ubuntu itself or if it's an issue related to the Ubuntu image that you use as basis for the server.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I've ran the auto-install command you used on a clean and empty Ubuntu system /20.04.3 LTS (Focal Fossa)) and there was no such error. So there must be something wrong with your system image that probably prevents the installation of PHP 7.4 in the first place which then causes the update-alternatives command to fail when it tries to select the default PHP version.

    I also ran both commands manually and they worked fine here:

    Code:
    update-alternatives --set php-cgi /usr/bin/php-cgi7.4
    update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock
    Please run the commands and post the result.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    and please post the result of:

    cat /etc/os-release
     
  9. Abhishek.kr

    Abhishek.kr New Member

    Here are the output as requested :
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try to run:

    apt-get install php7.4-fpm

    Which messages does apt show?
     
  11. Abhishek.kr

    Abhishek.kr New Member

     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    apt-get should not break the installation of a package even if computer crashes in the middle of installation. But to make sure that package really is installed completely, try
    Code:
    apt-get reinstall php7.4-fpm
    to force installing it again in case it is missing some files. The errors you get do look like this is the case.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Strange that it says installed but does not provide the php-fpm.sock alternative. Please run the command:

    Code:
    ls -la /etc/alternatives/php*
    and post the result.
     
  14. Abhishek.kr

    Abhishek.kr New Member

    Tried with re-install as suggested.
     
  15. Abhishek.kr

    Abhishek.kr New Member

    Here is the output :-
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Really strange, I must admit that I have no idea at the moment why the php-fpm.sock alternative is missing on your system. I just compared it with my test install, and it is there in /etc/alternatives plus my test install seems to use the exact same php 7.4 fpm package.

    Code:
    [email protected]:/home/administrator# apt-get install php7.4-fpm
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php7.4-fpm is already the newest version (7.4.25-1+ubuntu20.04.1+deb.sury.org+1).
    The following package was automatically installed and is no longer required:
      squashfs-tools
    Use 'apt autoremove' to remove it.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    [email protected]:/home/administrator# ls /etc/alternatives/php*
    /etc/alternatives/php  /etc/alternatives/php.1.gz  /etc/alternatives/php-cgi  /etc/alternatives/php-cgi.1.gz  /etc/alternatives/php-cgi-bin  /etc/alternatives/php-fpm.sock
    [email protected]:/home/administrator# ls -la /etc/alternatives/php*
    lrwxrwxrwx 1 root root 15 Nov  3 09:52 /etc/alternatives/php -> /usr/bin/php7.4
    lrwxrwxrwx 1 root root 31 Nov  3 09:52 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.4.1.gz
    lrwxrwxrwx 1 root root 19 Nov  3 09:52 /etc/alternatives/php-cgi -> /usr/bin/php-cgi7.4
    lrwxrwxrwx 1 root root 35 Nov  3 09:52 /etc/alternatives/php-cgi.1.gz -> /usr/share/man/man1/php-cgi7.4.1.gz
    lrwxrwxrwx 1 root root 23 Nov  3 09:48 /etc/alternatives/php-cgi-bin -> /usr/lib/cgi-bin/php8.0
    lrwxrwxrwx 1 root root 24 Nov  3 10:58 /etc/alternatives/php-fpm.sock -> /run/php/php7.4-fpm.sock
    [email protected]:/home/administrator#
    Maybe someone else has an Idea what might cause this.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    What you can try as a temporary workaround is to run:

    ln -s /run/php/php7.4-fpm.sock /etc/alternatives/php-fpm.sock
    does the command:

    update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock

    still throws an error then? if not, rerun the ispconfig autoinstaller again on the system to finish the setup.
     
  18. Abhishek.kr

    Abhishek.kr New Member

    Yes, still have same error.
     
  19. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Is php7.4-fpm running? I think the daemon has to be running for the socket file to exist, so that update-alternatives doesn't complain.
     
    Th0m likes this.

Share This Page