Google Cloud - Upgrade PHP version: Difference between revisions
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 3: | Line 3: | ||
sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update | sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Install PHP 8.2 for Apache == | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo apt install php8.2 | sudo apt install php8.2 | ||
| Line 33: | Line 34: | ||
sudo apt-get purge php7.* | sudo apt-get purge php7.* | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Google Cloud]] | |||
[[Category:PHP]] | |||
Latest revision as of 18:32, 26 October 2025
Add PPA for PHP 8.2
sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update
Install PHP 8.2 for Apache
sudo apt install php8.2
Install PHP 8.2 Extensions
sudo apt install php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-opcache php8.2-soap php8.2-zip php8.2-intl -y
Check PHP version
php -v
Enable PHP 8.2 for Apache
sudo a2dismod php7.4
sudo a2enmod php8.2
sudo service apache2 restart
Uninstall the old php version
sudo apt-get purge php7.*