Skip to content

Commit

Permalink
Added php install script
Browse files Browse the repository at this point in the history
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
  • Loading branch information
florentdestremau committed Jun 13, 2024
1 parent 6512cde commit 4bffcbe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions install/php.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions uninstall/php.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4bffcbe

Please sign in to comment.