PHP 7.4+8.0+8.1 and Apache

Discussion in 'Installation/Configuration' started by TonyG, Jun 24, 2022.

  1. TonyG

    TonyG Active Member

    I'm building a new Ubuntu v22 system and would like to support PHP 7.4+8.0+8.1. Now that the Apache LoadModule directive uses a generic "php_module" which is not version-specific, there are conflicts and Apache doesn't start.

    My approach has been to install each of the PHP versions in-turn, and then to install Apache. Would it be better to install Apache with 8.1 and then go back to support the others? It would make sense if the first/default module is "php_module" with the latest version 8.1, and then each site can configure as they wish.

    Can we a2enmod php8.1 and then a2enmod others without creating issues after the base Apache has been installed?

    So far, I can have all three versions of PHP installed. If I a2enmod php8.1 and a2dismod the others, then Apache does start OK. I'm just concerned what happens when we need to run a lower version in a site and we need the other modules...

    I haven't found any documentation on this - a simple link to an existing resource would be ideal.
    Thanks!
     
    Last edited: Jun 24, 2022
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What I do and would recommend is purge all mod_php versions, enable the correct php-fpm version for your system default, then install all needed php versions as alternative php versions, which is what all sites are set to.
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This was discussed and told several times already, that ISPConfig is yet to support Ubuntu 22.04 since its default is php8.1.

    The installation of the server however should all be almost the same including adding multiple php for website usages.

    You may try to make ISPConfig work by changing default php to php7.4 but may face other problems, so it is basically not recommended nor advisable for production.
     
  4. TonyG

    TonyG Active Member

    Thanks guys. I'm testing Ubuntu 22 for the first time in preparation for later upgrades. My first priority was to understand any anomalies like this in the OS version without ISPConfig. Then I was going to apply what I've learned to ISPConfig. I owe you an apology here because I did not want to put this enquiry in the ISPConfig subforum, but accidentally did.

    EDIT: The mistake wasn't mine. I wasn't asking about ISPConfig but the thread was moved here ... and then I was told ISPConfig doesn't support what I was talking about. HAHA - That's like dragging someone across the border and then shooting them for invasion. OK, we're on the same page.


    When it appeared that there were no issues with 8.1 as the default in the OS, I wanted to experiment with ISPConfig - yes, expecting that there would be some conflicts. I loaded the latest nightly for experimenting and it immediately showed an error. No problem with that. I got the official ISPConfig 3.2.8.p1, and yes, then saw v8 is not supported. So I switched the PHP version with update-alternatives, disabled v8 with a2disconf and a2dismod, and enabled 7.4. Now I'm working forward with this.

    Based on the advice of @ahrasis, I will only use Ubuntu v22 for experimenting. Ultimately I want to install a new v20 with the latest ISPConfig, and migrate my existing primary controller, which is showing some low level issues that I want to completely get away from. So this is a good opportunity to get into a new environment.

    This dove-tails with my enquiry about secondary server syncs - which I will need to do when I replace the secondary server as well.

    And all of this is related to another post I made here about being terrified to upgrade because Postfix/Dovecot settings are now handled differently in ISPConfig. :) I'm doing a lot of testing and data moving, and will do some number of test migrations before doing a final move and making a new system live.

    Thanks for your patience.
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I like the analogy. :). My mistake in that one.
     
    TonyG likes this.

Share This Page