Debian System Install latest LNMP compile latest php7.1.2 and nginx1.10.3 and mysql5.7 and 5.6

Source: Internet
Author: User
Tags fpm openssl

Aptitude install Nginx/mysql, compile and install php7.1.2

Created Thursday 232 months 2017

First, configure the image source, the default Debian does not have the latest version of Nginx, as well as the php7.0 version (compiled installation), mysql5.7 version!
1.1 Vim /etc/apt/sources.list Add the following
Deb http://nginx.org/packages/debian/ jessis Nginx
DEB-SRC http://nginx.org/packages/debian/ jessis nginx


1.2 Installing MySQL Community version 5.7
wget Https://repo.mysql.com//mysql-apt-config_0.8.2-1_all.deb
Dpkg-i Mysql-apt-config_0.8.2-1_all.deb
Choose the corresponding version, with 5.6 and 5.7 two versions, as well as tools.


Installing Nginx1.10.3
Aptitude Install Nginx
View version
[Email protected]:~#/usr/sbin/nginx-v
Nginx version:nginx/1.10.3
install MySQL
Aptitude Install mysql-server-5.6
Version information:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.6.35 MySQL Community Server (GPL)


Compiling and installing php7.1.2
Make compile and install
Build-essential autoconf automake Libtool Bison re2c
Dependent package installation (most of the dependencies are missing in this case, find)
Libxml2-dev Libssl-dev Libbz2-dev Libjpeg-dev Libpng-dev

Libxpm-dev Libfreetype6-dev Libgmp-dev Libgmp3-dev

Libmcrypt-dev Libmysqlclient15-dev Libpspell-dev Librecode-dev
Libcurl4-gnutls-dev Libgmp-dev Libgmp3-dev Librecode-dev

Libpspell-dev Libmysqlclient15-dev Libmcrypt-dev Libxml2-dev
OpenSSL error:
ln-s/usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/


Download php7.1.2

wget http://cn2.php.net/distributions/php-7.1.2.tar.gz
Tar zxf php-7.1.2.tar.gz
CD php-7.1.2
./configure--PREFIX=/USR/LOCAL/PHP7--SYSCONFDIR=/ETC/PHP7 \

--WITH-CONFIG-FILE-PATH=/ETC/PHP7--enable-fpm--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd--with-mhash--with-openssl--with-zlib \

--with-bz2--with-curl--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir \

--with-zlib--enable-mbstring--with-mcrypt--enable-sockets--with-iconv-dir \

--with-xsl--enable-zip--with-pcre-dir--with-pear--enable-session \

--enable-gd-native-ttf--enable-xml--with-freetype-dir--enable-gd-jis-conv \

--enable-inline-optimization--enable-shared--enable-bcmath \

--enable-sysvmsg--enable-sysvsem--enable-sysvshm--enable-mbregex \

--enable-pcntl--with-xmlrpc--with-gettext--enable-exif--with-readline \

--with-recode--with-tidy

Compiling the installation

Make && make install



Configuring Nginx PHP Files
Configuration files are in/etc directory, the first backup good
#cd /etc/nginx
#cp nginx.conf Nginx.conf.bak
#vim nginx.conf
Change the user XXX to the following:
User Www-data;

Exit at entry
CD conf.d/
CP default.conf Default.conf.bak
Vim default.conf
Modified to read as follows:
server {
Listen 80;
server_name localhost;

Location/{

root/usr/share/nginx/html;
Index index.php index.html index.htm;

}

Error_page 502 503 504/50x.html;
Location =/50x.html {

root/usr/share/nginx/html;

}

Location ~ \.php$ {

root/usr/share/nginx/html;

Fastcgi_pass Unix:/run/php/php7.0-fpm.sock;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;

}

}

Configuring PHP Files
[email protected]:~# cd/ETC/PHP7/PHP-FPM.D
[email protected]:# CP Www.conf.default Www.conf.default.bak
[email protected]:# mv Www.conf.default lnmp.conf
[email protected]:# vim lnmp.conf
user = Nobody changed to user = Www-data
Group = Nobody changed to group = Www-data
Listen = 127.0.0.1:9000 changed to listen =/run/php/php7.0-fpm.sock
Listen.owner = Www-data Uncomment to change to this
Listen.group = Www-data Uncomment to change to this
Listen.mode = 0660 Uncomment to change to this

Then copy the php.ini-production in the unpacked installation package under the/etc/php7/directory.


Start the service
/etc/init.d/nginxStart/restart /stop
/USR/LOCAL/PHP7/SBIN/PHP-FPM
/etc/init.d/mysql Start
Process
[email protected]:~# ps-ef | grep php-fpm
Root 1070 1 0 10:33? 00:00:00 Php-fpm:master Process (/etc/php7/php-fpm.conf)
Www-data 1071 1070 0 10:33? 00:00:00 Php-fpm:pool www
Www-data 1072 1070 0 10:33? 00:00:00 Php-fpm:pool www
Root 1106 1065 0 10:42 pts/0 00:00:00 grep php-fpm
[email protected]:~# ps-ef | grep nginx
Root 512 1 0 10:29? 00:00:00 Nginx:master process/usr/sbin/nginx-c/etc/nginx/nginx.conf
Www-data 513 512 0 10:29? 00:00:00 Nginx:worker Process
Root 1108 1065 0 10:42 pts/0 00:00:00 grep nginx
[email protected]:~# ps-ef | grep mysql
MySQL 1179 1 0 10:47? 00:00:00/bin/sh/usr/bin/mysqld_safe
MySQL 1455 1179 1 10:47? 00:00:00/usr/sbin/mysqld--basedir=/usr--datadir=/var/lib/mysql--plugin-dir=/usr/lib/mysql/plugin--log-error=/ Var/log/mysql/error.log--pid-file=/var/run/mysqld/mysqld.pid--socket=/var/run/mysqld/mysqld.sock--port=3306
Root 1505 1065 0 10:47 pts/0 00:00:00 grep mysql

End Process
Killall PHP-FPM

Most of the errors can be accessed Cat/var/log/nginx/error.log view, and then google!




Debian System Install latest LNMP compile latest php7.1.2 and nginx1.10.3 and mysql5.7 and 5.6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.