diff --git a/debian/install.sh b/debian/install.sh index 2b6ca2e..8764e0b 100755 --- a/debian/install.sh +++ b/debian/install.sh @@ -154,7 +154,7 @@ server_address=$(hostname -I) #restart services systemctl daemon-reload -systemctl restart php5-fpm +systemctl restart php7.0-fpm systemctl restart nginx systemctl restart fail2ban diff --git a/debian/resources/nginx.sh b/debian/resources/nginx.sh index 96a060c..7476acd 100755 --- a/debian/resources/nginx.sh +++ b/debian/resources/nginx.sh @@ -9,8 +9,29 @@ cd "$(dirname "$0")" #send a message verbose "Installing the web server" +arch=$(uname -m) +real_os=$(lsb_release -is) +codename=$(lsb_release -cs) +if [ $real_os = 'Ubuntu' ]; then + #16.10.x - */yakkety/ + #16.04.x - */xenial/ + #14.04.x - */trusty/ + if [ $codename = 'trusty' ]; then + LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php + fi +else + #9.x - */stretch/ + #8.x - */jessie/ + if [ $codename = 'jessie' ]; then + echo "deb http://packages.dotdeb.org $codename all" > /etc/apt/sources.list.d/dotdeb.list + echo "deb-src http://packages.dotdeb.org $codename all" >> /etc/apt/sources.list.d/dotdeb.list + wget -O - https://www.dotdeb.org/dotdeb.gpg | apt-key add - + fi +fi +apt-get update + #install dependencies -apt-get install -y --force-yes nginx php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt +apt-get install -y nginx php7.0 php7.0-cli php7.0-fpm php7.0-pgsql php7.0-sqlite3 php7.0-odbc php7.0-curl php7.0-imap php7.0-mcrypt php7.0-xml #enable fusionpbx nginx config cp nginx/fusionpbx /etc/nginx/sites-available/fusionpbx diff --git a/debian/resources/nginx/fusionpbx b/debian/resources/nginx/fusionpbx index d544f1c..6218dd4 100644 --- a/debian/resources/nginx/fusionpbx +++ b/debian/resources/nginx/fusionpbx @@ -14,7 +14,7 @@ server{ } location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; @@ -95,7 +95,7 @@ server { } location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; @@ -181,7 +181,7 @@ server { } location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; diff --git a/debian/resources/php.sh b/debian/resources/php.sh index 2e1c20a..f70111d 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -10,12 +10,12 @@ cd "$(dirname "$0")" verbose "Configuring PHP" #update config if source is being used -sed 's#post_max_size = .*#post_max_size = 80M#g' -i /etc/php5/fpm/php.ini -sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i /etc/php5/fpm/php.ini +sed 's#post_max_size = .*#post_max_size = 80M#g' -i /etc/php/7.0/fpm/php.ini +sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i /etc/php/7.0/fpm/php.ini -#restart php5-fpm +#restart php-fpm #systemd -/bin/systemctl restart php5-fpm +/bin/systemctl restart php7.0-fpm #init.d -#/usr/sbin/service php5-fpm restart +#/usr/sbin/service php7.0-fpm restart