Last active
August 19, 2017 10:29
-
-
Save devlifeX/3dc66ff50ee0b46371cad050dafdb2f7 to your computer and use it in GitHub Desktop.
Install php 7 on debian 8
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
#https://www.cyberciti.biz/faq/installing-php-7-on-debian-linux-8-jessie-wheezy-using-apt-get/ | |
#Package list | |
dpkg --list | grep php | awk '/^ii/{ print $2}' | |
#Uninstall | |
x="$(dpkg --list | grep php | awk '/^ii/{ print $2}')" | |
sudo apt-get -y --purge remove $x | |
#Add source list | |
sudo touch /etc/apt/sources.list.d/dotdeb.list | |
sudo bash -c "echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list" | |
sudo bash -c "echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/dotdeb.list" | |
#Install Key | |
cd /tmp | |
wget https://www.dotdeb.org/dotdeb.gpg | |
sudo apt-key add dotdeb.gpg | |
sudo rm dotdeb.gpg | |
#update apt | |
sudo apt-get update | |
#install equivalent of php5 packages | |
y="$(sed 's/php5/php7.0/g' <<<$x)" | |
sudo apt-get -y install $y | |
#change in php.ini | |
#/etc/php/7.0/cli/php.ini | |
cgi.fix_pathinfo=0 | |
sudo service nginx restart | |
#Configure | |
sudo vim /etc/php/7.0/fpm/pool.d/www.conf | |
[...] | |
user = nginx | |
group = nginx | |
;listen = /var/run/php5-fpm.sock | |
listen = 127.0.0.1:9000 | |
[...] | |
#restart | |
sudo service nginx restart | |
sudo service php7.0-fpm restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment