Hello, Do you have any guide to update PHP from let's say version 7.3 to version 7.4 without breaking Apache? Thanks
Thanks but not very clear for me This is what I did. apt install $(apt list --installed | grep php7.3- | cut -d '/' -f1 | sed -e 's/7.3/7.4/g') So I installed all these packages php7.4-apcu php7.4-apcu-bc php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-imagick php7.4-imap php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip And then this to enable php7.4 module for apache, but it did not work. Code: root@ns32XXX22:/var/www# a2dismod php7.3 Module php7.3 disabled. To activate the new configuration, you need to run: service apache2 restart root@ns32XXX22:/var/www# a2enmod php7.4 Considering dependency mpm_prefork for php7.4: Considering conflict mpm_event for mpm_prefork: Considering conflict mpm_worker for mpm_prefork: Module mpm_prefork already enabled Considering conflict php5 for php7.4: Enabling module php7.4. To activate the new configuration, you need to run: service apache2 restart root@ns32XXX22:/var/www# service apache2 restart Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. root@ns32XXX22:/var/www# a2enmod php7.3 Considering dependency mpm_prefork for php7.3: Considering conflict mpm_event for mpm_prefork: Considering conflict mpm_worker for mpm_prefork: Module mpm_prefork already enabled Considering conflict php5 for php7.3: Enabling module php7.3. To activate the new configuration, you need to run: service apache2 restart root@ns32XXX22:/var/www# service apache2 restart I had to enable again php7.3 for apache. What am I doing wrong?
You are trying to change the default PHP version, but you should not. I suspect you are using ISPConfig? Add the versions as additional versions and select the version you want to use in your web settings. It is exactly described in the guide how to do this.
No, you should not do this. Mod-php should not be used, and you shouldn't change the default version.
What do you mean by changing the default version? I added a ppa with more php versions. And what do you mean by Mod-php should not be used? Please can you clarify?
Alright - I assumed you did, because most of the users on this forum do, especially the HowToForge supporters In that case, switch from mod-php to php-fpm with Code: a2dismod mpm_prefork php7.4 a2enmod mpm_event php-7.4fpm
Can you please elaborate why? I just followed the official guide in here https://help.ubuntu.com/16.04/serverguide/php.html