Create php.sh
This commit is contained in:
parent
0fbb3d8ad7
commit
8021065b0b
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
#move to script directory so all relative paths work
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
#includes
|
||||
. ./config.sh
|
||||
. ./colors.sh
|
||||
. ./environment.sh
|
||||
|
||||
#send a message
|
||||
verbose "Removing PHP 5 the web server"
|
||||
|
||||
#remove php5
|
||||
apt remove -y php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt
|
||||
|
||||
#add a repo for php 7.1
|
||||
if [ ."$os_codename" = ."jessie" ]; then
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates
|
||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
|
||||
fi
|
||||
apt-get update
|
||||
|
||||
#install php 7.1
|
||||
apt-get install -y php7.1 php7.1-cli php7.1-fpm php7.1-pgsql php7.1-sqlite3 php7.1-odbc php7.1-curl php7.1-imap php7.1-mcrypt php7.1-xml
|
||||
|
||||
#update the unix socket name
|
||||
sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.1-fpm.sock;#g'
|
||||
|
||||
#restart nginx
|
||||
service nginx restart
|
||||
Loading…
Reference in New Issue