1.1.1 resolving the dependencies of PHP software Installing basic dependency Packages yum install zlib-devellibxml2-devel Libjpeg-devellibjpeg-turbo-devel libiconv-devel -yyum install freetype-devellibpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -yrpm -qa zlib-devel libxml2-devel libjpeg-devellibjpeg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devellibcurl-devel libxslt-devel anti-error, so compile and install Libiconv software installation mkdir - p /home/oldboy/tools[[email protected] init.d]# cd /home/oldboy/tools/[[email protected] tools]# lltotal 338200drwxr-xr-x 22 root root 4096 May 22 11:17 libiconv-1.14-rw-r--r-- 1 root root 4984397 may 22 08:38 libiconv-1.14.tar.gz#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz download Software [[email protected] tools]# tar xf libiconv-1.14.tar.gz[[email protected] tools]# cd libiconv-1.14[[email protected] libiconv-1.14]# ./configure --prefix=/usr/local/libiconv[[ Email protected] libiconv-1.14]# make[[email protected] libiconv-1.14]# make &NBSP;INSTALL[[EMAIL&NBSP;PROTECTED]&NBSP;LIBICONV-1.14]#&NBSP;CD&NBSP, .... /[[email protected] tools]# #wget -o /etc/yum.repos.d/epel.repo http:// mirrors.aliyun.com/repo/epel-6.repo[[email protected] tools]# yum -y install libmcrypt-devel mhash mcrypt[[email protected] tools]# rpm -qa Libmcrypt-devel mhash mcryptmhash-0.9.9.9-3.el6.x86_64libmcrypt-devel-2.5.8-9.el6.x86_ 64mcrypt-2.6.8-10.el6.x86_641.1.2 download unzip php software [[email protected] tools]# tar xF php-5.5.32.tar.gz[[email protected] tools]# cd php-5.5.32[[email protected] tools]# ./configure --prefix=/application/php-5.5.32 --with-mysql=/application/mysql/ --with-pdo-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-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --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-soap --enable-short-tags --enable-static -- with-xsl --with-fpm-user=www --with-fpm-group=www --enable-ftp --enable-opcache=no# generating files #configure: creating ./config.status #creating main/internal_functions.c #creating main/internal_ functions_cli.c #+--------------------------------------------------- -----------------+ #| license: | #| this software is subject to the php License, available in this | #| distribution in the file license. by continuing this installation | #| process, you are bound by the terms of this license agreement. | #| if you do not agree with the terms of this license, you must abort | #| the installation process at this point. | #+----------------------------------------------------------- ---------+ # #Thank you for using&nBsp php. This interface shows that the configuration work is no problem. # #防报错 Key Ln -s /application/mysql /lib/libmysqlclient.so.18 /usr/lib64/touch ext/phar/phar.pharmake Start compiling make install <- Create directory, generate program file information Learn fastcgi 1.1.3 php software program create soft link &NBSP;[[EMAIL&NBSP;PROTECTED]&NBSP;PHP-5.5.32]#&NBSP;LN -s /application/php-5.5.32//application/php 1.1.4 Configure PHP parsing files/configuration php-fpm configuration file [[email protected] tools] #cd /home/oldboy/tools/php-5.5.32 [[email protected] tools]# cp php.ini-production/application/php/lib/php.ini development of Php.ini-production and php.ini-development production File difference Comparison extension: file comparison command &NBSP;DIFF&NBFile comparison on Sp;zdiff vimdiff windows cd /application/php/etc/ cp php-fpm.conf.default php-fpm.conf 1.1.5 start PHP-FPM program [[email protected] php-5.5.32]# /application/php/sbin/php-fpm[[ email protected] php-5.5.32]# lsof -i:9000 <--- Confirm php 9000 port is starting correctly command pid user fd type device size/off node namephp-fpm 11515 root 7u ipv4 205849 0t0 TCP localhost:cslistener (LISTEN) php-fpm 11517 www 0u IPv4 205849 0t0 tcp localhost:cslistener (LISTEN) php-fpm 11910 www 0u Ipv4 205849 0t0 tcp localhost:cslistener (LISTEN) php-fpm 11912 www 0u IPv4 205849 0t0 TCP localhost:cslistener (LISTEN) [[email protected] php-5.5.32]# ps -ef|grep Php-fpmroot 11515 1 0 05:45 ? 00:00:01 php-fpm:master process (/ application/php-5.5.32/etc/php-fpm.conf) www 11517 11515 0 05:45 ? 00:00:17 php-fpm:pool www www 11910 11515 0 07:05 ? 00:00:16 php-fpm:pool www www 11912 11515 0 07:05 ? 00:00:17 php-fpm:pool www root 23687 23564 0 15:24 pts/0 00:00:00 grep --color=auto php-fpm1.1.6 wordpress blog Site Deployment configuration 1) Modify Nginx configuration file to make the Nginx program connect with PHP program [[Email protected] oldboy]# cd /application/nginx/conf/extra /[[email protected] extra]# vim blog.conf server { listen 80; server_name blog.etiantian.org; # location for static request processing location / { root html/blog; index index.php index.html index.htm; } <-- Need to be aware that editing modifies the default home file # dynamic request processing location location ~* .*\. (PHP|PHP5)?$ { root html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; &NBSP;&NBSP;}&NBSP;&NBSP;&NBSP;&NBSP,} Description: The use of Nginx location block to implement dynamic request and static request processing separately &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; 2) edit nginx and PHP connectivity test file and test echo ' <?phpphpinfo (); ?> ' >/ application/nginx/html/blog/test_info.php test Site curl http://blog.etiantian.org/index.html <-- Static Request site file information Test curl http://blog.etiantian.org/test_info.php <-- Dynamic Request site file information Test Description: When the PHP service stops, the 9000 port information disappears, That is, stop php error 502 error linux after the system test is complete , it is recommended to use the browser for the final test, the test effect is more obvious 3) edit the PHP and MySQL connectivity test file, and test a. CREATE DATABASE [[Email protected] ~]# /etc/init.d/mysqld startstarting mysql.. success! [[email protected] ~]# mysql -uroot -poldboy123warning: using a Password on the commandline interface can be insecure. Welcome to the mysql monitor. commands end with ; or \ g.your mysql connection id is 1server version: 5.6.34 mysql communityserver (GPL) copyright (c) 2000, 2016, oracle and/or itsaffiliates. all rights reserved. oracle is a registered trademark of oraclecorporation and/or Itsaffiliates. other names may be trademarksof their respectiveowners. type ' help; ' or ' \h ' for help. Type ' \c ' &NBSP;TOCLEAR&NBSP;THE&NBSP;CURRENT&NBSP;INPUT&Nbsp;statement.mysql> show databases; View current Database information mysql> create database wordpress; Create a database b. Add user Information Mysql> grant all on wordpress.* to ' wordpress ' @ ' localhost ' identified by ' oldboy123 '; mysql> grantall on wordpress.* to ' wordpress ' @ ' 172.16.1.0/ 255.255.255.0 ' identified by ' oldboy123 ';mysql> flush privileges; #drop [email protected] ' 172.16.1.8 '; <--- delete user information #select user,host frommysql.user; <--- View user information #mysql -uwordpress -poldboy123 <--- Test create a user connection #show databases; <--- View current database information c. test PHP and Database connectivity [[ email protected] /]# cd /application/nginx/html/blog/[[email protected] blog]# vim test_mysql.php<?php//$link _id=mysql_connect (' hostname ', ' user ', ' password '),//mysql -u user -p password -h host $link_id=mysql_connect (' localhost ', ' WordPress ', ' oldboy123 ') ormysql_error (); if ($link _id) { echo "Mysql successful by oldboy !\n "; }else{ echomysql_error (); }? >[[email protected] blog]# curl blog.etiantian.org/test_mysql.phpmysql successful by oldboy ! <--testing the connectivity of PHP to databases 4) Download and deploy WordPress blog program (https://cn.wordpress.org/ English website:https://www.wordpress.org/ ) [[email protected] tools]# wgethttps://cn.wordpress.org/ Wordpress-4.5.1-zh_cn.tar.gz[[email protected] tools]# tar xf wordpress-4.5.1-zh_ Cn.tar.gz [[email protected] tools]# mv wordpress/* /application/nginx/html/blog /[[email protected] tools]# chown -r www.www/application/nginx/html/blog/[[email protected] tools]# cd /application/nginx/html/blog[[email protected] blog]# lltotal 204-rw-r--r-- 1 www www 19 May 21 15:46index.html-rw-r--r-- 1 www www 418 may 22 12:49 index.php-rw-r--r-- 1 www www 19935 jan 3 02:51license.txt-rw-r--r-- 1 www www 7433 may 23 09:04readme.html-rw-r--r-- 1 www www 20 may 22 12:56test_info.php-rw-r--r-- 1 www www 313 may 22 12:54test_mysql.php Note: Verify that the Hosts file is parsed Browser page for WordPress deployment vim wp-config.php can modify the database connection parameters on WordPress
Interest
This article is from the "Light Dust" blog, please be sure to keep this source http://857803451.blog.51cto.com/12777961/1931495
LNMP PHP Software Installation steps