detailed PHP installation and LNMP complete construction-wordpress
Install the required Lib library [root@lnmp01 tools]# rpm-qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel LIBICONV-DEVELZLIB-DEVEL-1.2.3-29.EL6.X86_64[ROOT@LNMP01 tools]# rpm-qa freetype-devel libpng-devel gd-devel Libcurl-devel libxslt-devel[root@lnmp01 tools]# yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel LIBICONV-DEVEL-Y[ROOT@LNMP01 tools]# Yum Install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel-y Install Libiconv (Unable to install) [Root@lnmp01 tools]# Rzrz waiting to receive.??? A? Zmodem′??? £°′ctrl+c??? £?? ′?? Libiconv-1.14.tar.gz ... 100% 4867 KB 4867 kb/s 00:00:01 0′?? [Root@lnmp01 tools]# tar zxf libiconv-1.14.tar.gz[root@lnmp01 tools]# cd libiconv-1.14[root@lnmp01 libiconv-1.14]#. Configure--PREFIX=/USR/LOCAL/LIBICONV[ROOT@LNMP01 libiconv-1.14]# make[root@lnmp01 libiconv-1.14]# make install[ ROOT@LNMP01 libiconv-1.14]# CD. /Install the three-party Yum source related library [root@lnmp01 tools]# wget-o/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo[ root@LNMP01 tools]# yum-y Install libmcrypt-devel[root@lnmp01 tools]# yum-y install mahash[root@lnmp01 tools]# yum-y Install MCrypt Install PHP compilation php[root@lnmp01 tools]# cd/home/lufeng/tools[root@lnmp01 tools]# rz-y[root@lnmp01 tools]# tar zxf .... ..... [Root@lnmp01 tools]# cd php-5.3.27[root@lnmp01 tools]#./configure \--prefix=/application/php5.3.27 \--with-mysql= Mysqlnd \--with-iconv-dir=/usr/local/libiconv \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \-- WITH-LIBXML-DIR=/USR \--enable-xml \--disable-rpath \--enable-safe-mode \--enable-bcmath \--enable-shmop \-- Enable-sysvsem \--enable-inline-optimization \--with-curl \--with-curlwrappers \--enable-mbregex \--enable-fpm \-- Enable-mbstring \--with-mcrypt \--with-gd \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \-- Enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--enable-short-tags \--enable-zend-multibyte \-- Enable-static \--with-xsl \--with-fpm-user=nginx \--with-fpm-group=nginx \--enable-ftp+--------------------------------------------------------------------+| License: | | This software was subject to the PHP License, available in this | | Distribution in the file LICENSE. By continuing this installation | | Process, you is bound by the terms of this License agreement. || If you don't agree with the terms of this license, you must abort | | The installation process at this point. |+--------------------------------------------------------------------+ Thank for using PHP. [Root@lnmp01 php-5.3.27]# Touch ext/phar/phar.phar[root@lnmp01 php-5.3.27]# makebuild complete. Don ' t forget to run ' make test '. [Root@lnmp01 php-5.3.27]# make Install/home/lufeng/tools/php-5.3.27/build/shtool install-c Ext/phar/phar.phar/ Application/php5.3.27/binln-s-f/application/php5.3.27/bin/phar.phar/application/php5.3.27/bin/pharinstalling PDO headers:/application/php5.3.27/include/php/ext/pdo/Configuring PHP and booting [root@lnmp01 php-5.3.27]# ln-s/application/php5.3.27/application/php [Root@lnmp01 php-5.3.27 ]# ls-l/application/php [root@lnmp01 php-5.3.27]# ls php.ini*php.ini-development php.ini-production[root@lnmp01 php-5 .3.27]# CP Php.ini-production/application/php/lib/php.ini [ROOT@LNMP01 php-5.3.27]# cd/application/php/etc/[ ROOT@LNMP01 etc]# cp php-fpm.conf.default PHP-FPM.CONF[ROOT@LNMP01 etc]#/APPLICATION/PHP/SBIN/PHP-FPM[ROOT@LNMP01 etc]# ps-ef|grep php-fpmroot 7337 1 0 15:03? 00:00:00 Php-fpm:master Process (/application/php5.3.27/etc/php-fpm.conf) Nginx 7338 7337 0 15:03? 00:00:00 php-fpm:pool www nginx 7339 7337 0 15:03? 00:00:00 Php-fpm:pool www root 7341 6079 0 15:03 pts/0 00:00:00 grep php-fpm configuration nginx support PHP request access [root @lnmp01 blog]# cd/application/nginx/conf/extra/[root@lnmp01 extra]# cat blog.conf server {Listen 80; server_name Blog.lufeng.com; Location/{root Html/blog; Index index.html index.html; } location ~. *\. (PHP|PHP5) $ {root Html/blog; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Include fastcgi.conf; }}[root@lnmp01 conf]#. /SBIN/NGINX-T nginx:the configuration file/application/nginx-1.6.3/conf/nginx.conf syntax is Oknginx:configuratio N file/application/nginx-1.6.3/conf/nginx.conf test is successful[root@lnmp01 conf]#. /sbin/nginx-s reload[root@lnmp01 conf]# CD. /html/blog/[root@lnmp01 blog]# echo "<?php phpinfo ()?>" >test_info.php[root@lnmp01 blog]# cat test_info.php & lt;? PHP phpinfo ();?> Deployment Blog Program-mysql [root@mysql-server ~]# mysql-uroot-penter password:mysql> CREATE DATABASE wordp Ress;mysql> show databases like ' WordPress '; Mysql> Grant all on wordpress.* to wordpress@ ' 192.1.1.% ' identified by ' 199429 ';mysql> show Grants for wordpress@ ' 192.1.1.% ';mysql> select User,host from mysql.user;mysql> quit Nginx with PHP environment configuration preparation [ROOT@LNMP01 extra ]# CD. /.. /HTML/BLOG/[ROOT@LNMP01 blog]# rz[root@lnmp01 blog]# tar xf wordpress-4.7.2-zh_cn.tar.gz [root@lnmp01 blog]# Lstest_ info.php WordPress wordpress-4.7.2-zh_cn.tar.gz[root@lnmp01 blog]# rm test_info.php[root@lnmp01 blog]# MV wordpress/*. [Root@lnmp01 blog]#/bin/mv wordpress-4.7.2-zh_cn.tar.gz/home/lufeng/tools/[root@lnmp01 blog]# chown-r Nginx.nginx. /BLOG/[ROOT@LNMP01 blog]# Ls-l