PHP Version Update
Update PHP Version, Update Apache2 PHP Version, Swich PHP version on Ubuntu
Clean All PHP
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
Update PHP version
- Update php version
sudo apt update sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php
- install php 7.4
sudo apt update sudo apt-get install -y php7.4
Swich PHP version
- Swich Terminal PHP version
sudo update-alternatives --set php /usr/bin/php7.4
- Swich php-fpm version ```sh
# Update Apache2 PHP version
- Install apache2 mods
```sh
sudo apt update
sudo apt-get install -y libapache2-mod-php7.4
- Enter apache2 mods directory
cd /etc/apache2/mods-enabled
- Check current php vesion
ls -l |grep php
-
Remove
php[version].conf
andphp[version].load
file - Create link file for new php version
ln -s ../mods-enabled/php[version].conf php[version].conf ln -s ../mods-enabled/php[version].load php[version].load
- Restart apache2
sudo systemctl restart apache2
https://websiteforstudents.com/install-php-8-0-on-ubuntu-20-04-18-04/