LNMP compile and install PHP and LNMP configuration and authentication instance sharing

Source: Internet
Author: User


Compiling an installed environment

Host for 172.25.23.6 hostname:server6.com
Kernel version: 2.6.32-431.el6.x86_64
Use packages as php-5.6.20.tar.bz2
Additional Packages:
libmcrypt-2.5.8-9.el6.x86_64.rpm
libmcrypt-devel-2.5.8-9.el6.x86_64.rpm

    • ./configureError in execution

    • Error:

Configure:error:xml2-config not found. Please check your LIBXML2 installation.
    • Solve:

[Root@server6 php-5.6.20]# Yum install-y libxml2-devel
    • Error:

Configure:error:Please Reinstall the Libcurl distribution-    easy.h should is in <curl-dir>/include/curl/
    • Solve

[Root@server6 php-5.6.20]# Yum Install curl-devel-y
    • Error:

If Configure fails try--with-vpx-dir=<dir>configure:error:jpeglib.h not found.
    • Solve

[Root@server6 php-5.6.20]# Yum install-y libjpeg-turbo-devel
    • Error:

If Configure fails try--with-vpx-dir=<dir>checking for Jpeg_read_header in-ljpeg ... yesconfigure:error:png.h not Found.
    • Solve

[Root@server6 php-5.6.20]# Yum Install libpng-devel-y
    • Error:

If Configure fails try--with-xpm-dir=<dir>configure:error:freetype-config not found.
    • Solve

[Root@server6 php-5.6.20]# Yum Install freetype-devel-2.3.11-14.el6_3.1.x86_64-y
    • Error:

Configure:error:Unable to locate Gmp.h
    • Solve

[Root@server6 php-5.6.20]# Yum Install gmp-devel-4.3.1-7.el6_2.2.x86_64-y
    • Error:

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
    • Solve

Libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# Yum Install ~/ libmcrypt-*-y
    • Error:

Configure:error:Could not find Net-snmp-config binary. Please check your NET-SNMP installation.
    • Solve

[Root@server6 php-5.6.20]# Yum Install net-snmp-devel-y
    • To compile

[Root@server6 php-5.6.20]#./configure--prefix=/usr/local/lnmp/php/\>--with-config-file-path=/usr/local/lnmp/  Php/etc \>--with-openssl \>--with-snmp \>--with-gd \>--with-zlib \>--with-curl \>--with-libxml-dir \>--with-png-dir \>--with-jpeg-dir \>--with-freetype-dir \>--with-gettext \>--without-pear \>--wi Th-gmp \>--enable-inline-optimization \>--enable-soap \>--enable-ftp \>--enable-sockets>-- enable-mbstring>--with-mysql>--with-mysqli>--with-pdo-mysql>--enable-mysqlnd>--enable-fpm>-- with-fpm-user=nginx>--with-fpm-group=nginx>--with-mcrypt >--with-mhash
    • Execution completion needs to occur

    • Then execute the make command

[Root@server6 php-5.6.20]# make No log handling enabled-turning on stderr loggingcreated directory:/var/lib/net-snmp/mi B_indexesgenerating phar.pharpear Package php_archive not installed:generated Phar would require PHP ' s Phar Extension be E Nabled.clicommand.incdirectorytreeiterator.incinvertedregexiterator.incdirectorygraphiterator.incpharcommand.incphar.inc
    • Ensure that results are required to appear

    • After executionmake install

[Root@server6 php-5.6.20]# make installinstalling shared extensions:     /usr/local/lnmp/php/lib/php/extensions/ no-debug-non-zts-20131226/installing php cli binary:        /usr/local/lnmp/php/bin/installing php cli man page:      / usr/local/lnmp/php/php/man/man1/installing php FPM binary:        /usr/local/lnmp/php/sbin/
    • Need to appear

    • Modifying a configuration file

[Root@server6 php-5.6.20]# cd/usr/local/lnmp/php/[root@server6 php]# CD ETC/[ROOT@SERVER6 etc]# CP Php-fpm.conf.default PHP-FPM.CONF[[ROOT@SERVER6 etc]# CP ~/php-5.6.20/php.ini-production/usr/local/lnmp/php/etc/ Ini
    • Modify, the preceding value represents the line number

[Root@server6 etc]# vim php.ini925  date.timezone = asia/shanghai1001 pdo_mysql.default_socket=/usr/local/lnmp/ mysql/data/mysql.sock1150 Mysql.default_socket =/usr/local/lnmp/mysql/data/mysql.sock1209 Mysqli.default_socket =/ Usr/local/lnmp/mysql/data/mysql.sock[root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid
    • Copy Startup scripts

[Root@server6 php-5.6.20]# cd SAPI/FPM/[ROOT@SERVER6 fpm]# PWD/ROOT/PHP-5.6.20/SAPI/FPM[ROOT@SERVER6 fpm]# CP Init.d.php-fpm/etc/init.d/php-fpm[root@server6 fpm]# chmod +x/etc/init.d/php-fpm
    • Start the service and view the status

[Root@server6 fpm]#/etc/init.d/php-fpm startstarting php-fpm done  

    • Modified Nginx configuration file

[Root@server6 fpm]# cd/usr/local/lnmp/nginx/conf/[root@server6 conf]# vim nginx.conf location    ~ \.php$ {            root< c6/>html;            Fastcgi_pass   127.0.0.1:9000;            Fastcgi_index  index.php;            Fastcgi_param  script_filename  /scripts$fastcgi_script_name;            Include        fastcgi.conf;        }
    • Test the correctness of the modified configuration file

[Root@server6 conf]# nginx-tnginx:the configuration file/usr/local/lnmp/nginx/conf/nginx.conf syntax is OKNGINX:CONFI Guration file/usr/local/lnmp/nginx/conf/nginx.conf test is SUCCESSFUL[ROOT@SERVER6 conf]# nginx


* Check if your service is up and running

* To php provide the default page

[Root@server6 nginx]# cd html/[root@server6 html]# ls50x.html index.html[root@server6  html]# vim index.php<? Phpphpinfo ()?>
    • Accessing Tests through a browser

    • Install Discuz Forum Program

[Root@server6 ~]# unzip discuz_x3.2_sc_utf8.zip-d/usr/local/lnmp/nginx/html/[root@server6 ~]# cd/usr/local/lnmp/ NGINX/HTML/[ROOT@SERVER6 html]# MV Upload/bbs[root@server6 html]# CD bbs/[root@server6 bbs]# chmod 777 Config/data/uc_c lient/uc_server/-R
    • Configure through the browser

    • DiscuzThe Welcome page

    • Need to make sure that this page does not x appear red

    • Installation page for database connection success

      • Access through the following connection

      • To see more information about the database.

      • ultraxFor Discuz the establishment of the database;

      • Information about the tables in the database

    • compiler installation for Nginx and MySQL

http://blog.csdn.net/qq_36294875/article/details/79352522 [MySQL5.7.11编译安装]
http://blog.csdn.net/qq_36294875/article/details/79344943[Nginx的编译安装以及简单的配置]

    • Compiling an installed environment

Host for 172.25.23.6 hostname:server6.com
Kernel version: 2.6.32-431.el6.x86_64
Use packages as php-5.6.20.tar.bz2
Additional Packages:
libmcrypt-2.5.8-9.el6.x86_64.rpm
libmcrypt-devel-2.5.8-9.el6.x86_64.rpm

    • ./configureError in execution

    • Error:

Configure:error:xml2-config not found. Please check your LIBXML2 installation.
    • Solve:

[Root@server6 php-5.6.20]# Yum install-y libxml2-devel
    • Error:

Configure:error:Please Reinstall the Libcurl distribution-    easy.h should is in <curl-dir>/include/curl/
    • Solve

[Root@server6 php-5.6.20]# Yum Install curl-devel-y
    • Error:

If Configure fails try--with-vpx-dir=<dir>configure:error:jpeglib.h not found.
    • Solve

[Root@server6 php-5.6.20]# Yum install-y libjpeg-turbo-devel
    • Error:

If Configure fails try--with-vpx-dir=<dir>checking for Jpeg_read_header in-ljpeg ... yesconfigure:error:png.h not Found.
    • Solve

[Root@server6 php-5.6.20]# Yum Install libpng-devel-y
    • Error:

If Configure fails try--with-xpm-dir=<dir>configure:error:freetype-config not found.
    • Solve

[Root@server6 php-5.6.20]# Yum Install freetype-devel-2.3.11-14.el6_3.1.x86_64-y
    • Error:

Configure:error:Unable to locate Gmp.h
    • Solve

[Root@server6 php-5.6.20]# Yum Install gmp-devel-4.3.1-7.el6_2.2.x86_64-y
    • Error:

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
    • Solve

Libmcrypt-2.5.8-9.el6.x86_64.rpmlibmcrypt-devel-2.5.8-9.el6.x86_64.rpm[root@server6 php-5.6.20]# Yum Install ~/ libmcrypt-*-y
    • Error:

Configure:error:Could not find Net-snmp-config binary. Please check your NET-SNMP installation.
    • Solve

[Root@server6 php-5.6.20]# Yum Install net-snmp-devel-y
    • To compile

[Root@server6 php-5.6.20]#./configure--prefix=/usr/local/lnmp/php/\>--with-config-file-path=/usr/local/lnmp/  Php/etc \>--with-openssl \>--with-snmp \>--with-gd \>--with-zlib \>--with-curl \>--with-libxml-dir \>--with-png-dir \>--with-jpeg-dir \>--with-freetype-dir \>--with-gettext \>--without-pear \>--wi Th-gmp \>--enable-inline-optimization \>--enable-soap \>--enable-ftp \>--enable-sockets>-- enable-mbstring>--with-mysql>--with-mysqli>--with-pdo-mysql>--enable-mysqlnd>--enable-fpm>-- with-fpm-user=nginx>--with-fpm-group=nginx>--with-mcrypt >--with-mhash
    • Execution completion needs to occur

    • Then execute the make command

[Root@server6 php-5.6.20]# make No log handling enabled-turning on stderr loggingcreated directory:/var/lib/net-snmp/mi B_indexesgenerating phar.pharpear Package php_archive not installed:generated Phar would require PHP ' s Phar Extension be E Nabled.clicommand.incdirectorytreeiterator.incinvertedregexiterator.incdirectorygraphiterator.incpharcommand.incphar.inc
    • Ensure that results are required to appear

    • After executionmake install

[Root@server6 php-5.6.20]# make installinstalling shared extensions:     /usr/local/lnmp/php/lib/php/extensions/ no-debug-non-zts-20131226/installing php cli binary:        /usr/local/lnmp/php/bin/installing php cli man page:      / usr/local/lnmp/php/php/man/man1/installing php FPM binary:        /usr/local/lnmp/php/sbin/
    • Need to appear

    • Modifying a configuration file

[Root@server6 php-5.6.20]# cd/usr/local/lnmp/php/[root@server6 php]# CD ETC/[ROOT@SERVER6 etc]# CP Php-fpm.conf.default PHP-FPM.CONF[[ROOT@SERVER6 etc]# CP ~/php-5.6.20/php.ini-production/usr/local/lnmp/php/etc/ Ini
    • Modify, the preceding value represents the line number

[Root@server6 etc]# vim php.ini925  date.timezone = asia/shanghai1001 pdo_mysql.default_socket=/usr/local/lnmp/ mysql/data/mysql.sock1150 Mysql.default_socket =/usr/local/lnmp/mysql/data/mysql.sock1209 Mysqli.default_socket =/ Usr/local/lnmp/mysql/data/mysql.sock[root@server6 etc]# vim php-fpm.conf25 pid = run/php-fpm.pid
    • Copy Startup scripts

[Root@server6 php-5.6.20]# cd SAPI/FPM/[ROOT@SERVER6 fpm]# PWD/ROOT/PHP-5.6.20/SAPI/FPM[ROOT@SERVER6 fpm]# CP Init.d.php-fpm/etc/init.d/php-fpm[root@server6 fpm]# chmod +x/etc/init.d/php-fpm
    • Start the service and view the status

[Root@server6 fpm]#/etc/init.d/php-fpm startstarting php-fpm done  

    • Modified Nginx configuration file

[Root@server6 fpm]# cd/usr/local/lnmp/nginx/conf/[root@server6 conf]# vim nginx.conf location    ~ \.php$ {            root< c6/>html;            Fastcgi_pass   127.0.0.1:9000;            Fastcgi_index  index.php;            Fastcgi_param  script_filename  /scripts$fastcgi_script_name;            Include        fastcgi.conf;        }
    • Test the correctness of the modified configuration file

[Root@server6 conf]# nginx-tnginx:the configuration file/usr/local/lnmp/nginx/conf/nginx.conf syntax is OKNGINX:CONFI Guration file/usr/local/lnmp/nginx/conf/nginx.conf test is SUCCESSFUL[ROOT@SERVER6 conf]# nginx


* Check if your service is up and running

* To php provide the default page

[Root@server6 nginx]# cd html/[root@server6 html]# ls50x.html index.html[root@server6  html]# vim index.php<? Phpphpinfo ()?>
    • Accessing Tests through a browser

    • Install Discuz Forum Program

[Root@server6 ~]# unzip discuz_x3.2_sc_utf8.zip-d/usr/local/lnmp/nginx/html/[root@server6 ~]# cd/usr/local/lnmp/ NGINX/HTML/[ROOT@SERVER6 html]# MV Upload/bbs[root@server6 html]# CD bbs/[root@server6 bbs]# chmod 777 Config/data/uc_c lient/uc_server/-R
    • Configure via browser

    • Discuz Welcome Page

    • Need to make sure this page is not red x appears

    • Database connection Successful Installation page

      • Access

      • to see more information about the database from the following connection

      • ultrax is Discuz the database established by the ;

      • Information about the tables in the database

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.