Skip to content

Instantly share code, notes, and snippets.

@githubjeka
Last active November 20, 2018 21:36
Show Gist options
  • Save githubjeka/4ef139b71479bbe1c8fa to your computer and use it in GitHub Desktop.
Save githubjeka/4ef139b71479bbe1c8fa to your computer and use it in GitHub Desktop.
How install PHP 5.6.0, Nginx, php-fpm on Debian

#Download Sorce PHP

mkdir /opt/php-5.6.0
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.6.0.tar.bz2/from/this/mirror -O php-5.6.0.tar.bz2
tar jxf php-5.6.0.tar.bz2
cd php-5.6.0/

#Configure and build PHP 5.6.0 Inside nano /etc/apt/sources.list add deb-src http://ftp.debian.org/debian YOUR_VERSION main contrib

apt-get build-dep php5
./configure \
--prefix=/opt/php-5.6.0 \
--enable-opcache \
--with-openssl \
--with-curl \
--with-mcrypt \
--enable-intl  \
--with-pdo-mysql \
--enable-fpm \
--enable-mbstring \
--with-bz2 \
--with-zlib
make
checkinstall -D make install
cp /usr/local/src/php5-build/php-5.6.0/php.ini-production /opt/php-5.6.0/lib/php.ini
cp /opt/php-5.6.0/etc/php-fpm.conf.default /opt/php-5.6.0/etc/php-fpm.conf

Change php.ini for youself.

#Configure PHP-FPM

cp /usr/local/src/php5-build/php-5.6.0/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
insserv php-fpm

Change php-fpm.conf for youself.

#Install NGINX Doc on rus - http://nginx.org/ru/linux_packages.html Doc on eng - http://nginx.org/en/linux_packages.html#stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment