Install first
Nginx
Mysql
Install most common dependency packages (without affecting installation, but are prone to problems with the use environment)
Freetype-devel libpng-devel gd-devel curl-devel (libcurl-devel) libxslt-devel
Zlib-devel libxml2-devel libjpeg-devel (libjpeg-turbo-devel) libiconv-devel
It is possible to libiconv-devel (if a third-party source is useful yum can be installed without this step)
Mkdir-p ~/tools && CD ~/tools &&\
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz &&\
Tar XF libiconv-1.14.tar.gz && CD libiconv-1.14 &&\
./configure--prefix=/usr/local/libiconv && make && make install && echo $?
Check if the installation is already
Rpm-qa xxx
Install the Libmcrypt library (compile and install)
wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
Tar XF libmcrypt-2.5.8.tar.gz && cd libmcrypt &&./configure && make && make install
Sleep 5
/sbin/ldconfig && cd libltdl/&&./configure--enable-ltdl-install && make && make Install
You can use Yum to install the above packages, some of which require a third-party source
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo &&\
Yum Install Libmcrypt-devel-y
Installing MCrypt
Yum install mcrypt-y && rpm-qa grep|mcrypt
Installing the Mhash Library
Yum Install Mhash mhash-devel-y
###############################
PHP5.3
Unzip into the directory
View compilation parameters
./configure--help
When using--WITH-MYSQL=MYSQLND, you do not need to install MySQL locally
Mysql,curl,fpm,with-fpm-user,with-fpm-group as key parameter
./configure \
--prefix=/application/php5.x.x \
--WITH-MYSQL=MYSQLND \
--WITH-MYSQLI=MYSQLND \
--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-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
(pending confirmation)--ENABLE-MYSQLND \
--WITH-PDO-MYSQL=MYSQLND \
--WITH-MYSQLI=MYSQLND \
If you use your own database then make the required processing (2 Select 1)
1. ln/application/mysql/lib/libmysqlclient.so.18/usr/lib64 && Touch Ext/phar/phar.phar
2. Echo '/application/mysql/lib ' >>/etc/ld.so.conf && ldconfig
Make && make install && ln-s/application/php5.3.xx/application/php
############################
PHP5.5 Partial parameter not available
./configure \
--prefix=/application/php5.x.x \
--WITH-MYSQL=MYSQLND \
--WITH-MYSQLI=MYSQLND \
--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=nginx \
--with-fpm-group=nginx \
--enable-ftp
##############################
Configuration parsing file (if you need to optimize PHP parsing, change the file)
Cp/application/php/php.ini-production/application/php/lib/php.ini
Configuring Process Files
Cp/application/php/etc/php-fpm.conf.default/application/php/etc/php-fpm.conf
Modifying the FPM configuration file
PID =/app/logs/php-fpm.pid
Error_log =/app/logs/php-fpm.log
Log_level = Error
; file descriptors
Rlimit = 32768
Events.mechanism = Epoll
Listen.owner = Nginx
Listen.group = Nginx
Pm.max_children = 1024
Pm.start_servers = 16
Pm.min_spare_servers = 5
Pm.max_spare_servers = 20
Pm.process_idle_timeout = 15s;
Pm.max_requests = 2048
Slowlog =/app/logs/$pool. Log.slow
Request_slowlog_timeout = 10
P_admin_value[sendmail_path] =/usr/sbin/sendmail-t-i-f [email protected]
Configure Nginx to append request processing to the server configuration
Location ~.*/. (PHP|PHP5)? $ {
Root Html/blog;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Include fastcgi.conf;
}
Re-check the load Nginx file
Page testing
<?php
phpinfo.php
?>
Database testing
<?php
$link _id=mysql_connect (' mysql_server ', ' MySQL ', ' password ') or mysql_error ();
if ($link _id) {
echo "successful!";
}else{
Echo Mysql_error ();
}
?>
This article is from the "Magic Conch" blog, please be sure to keep this source http://bilishell.blog.51cto.com/11756401/1829504
NOTES: CENTOS6 PHP configuration Test