-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install PHP only if not found and support 7.4.0RC2
- Loading branch information
1 parent
69f9b77
commit a398f54
Showing
6 changed files
with
69 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
sudo add-apt-repository ppa:ondrej/php -y | ||
sudo apt update -y | ||
sudo mkdir -p /run/php | ||
sudo apt install -y php$1 curl | ||
sudo apt autoremove -y | ||
sudo update-alternatives --set php /usr/bin/php$1 | ||
sudo curl -s https://getcomposer.org/installer | php | ||
sudo mv composer.phar /usr/local/bin/composer | ||
ua() | ||
{ | ||
for tool in php phar phar.phar php-cgi php-config phpize; do | ||
if [ -e "/usr/bin/$tool$version" ]; then | ||
sudo update-alternatives --set $tool /usr/bin/$tool$1; | ||
fi | ||
done | ||
} | ||
|
||
version=$(php-config --version | cut -c 1-3) | ||
if [ "$version" != "$1" ]; then | ||
if [ ! -e "/usr/bin/php$1" ]; then | ||
sudo add-apt-repository ppa:ondrej/php -y | ||
sudo apt update -y | ||
sudo apt install -y php$1 curl; | ||
sudo apt autoremove -y; | ||
fi | ||
ua $1; | ||
fi | ||
|
||
if [ ! -e "/usr/bin/composer" ]; then | ||
sudo curl -s https://getcomposer.org/installer | php; | ||
sudo mv composer.phar /usr/local/bin/composer; | ||
fi | ||
php -v | ||
composer -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters