Added php install script

Updated sqlite extension name

Added uninstall script

Removed ppa for PHP as 24.04 is already at latest

Updated composer install script

Added back ondrej/ppa and fixed uninstaller

Revert back to using ondrej/php
This commit is contained in:
Florent Destremau
2024-06-11 14:46:06 +02:00
parent 6512cde4f7
commit 4bffcbee40
2 changed files with 22 additions and 0 deletions

18
install/php.sh Normal file
View File

@@ -0,0 +1,18 @@
# install php with basic extensions
sudo add-apt-repository -y ppa:ondrej/php
sudo apt -y install php8.3 php8.3-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip}
# install composer, the PHP package manager
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer
rm composer-setup.php

4
uninstall/php.sh Normal file
View File

@@ -0,0 +1,4 @@
sudo apt -y purge "php8.3*"
sudo add-apt-repository -y --remove ppa:ondrej/php
sudo rm /usr/local/bin/composer