Installing a compiler such as gcc g++
Yum-y install gcc gcc-c++ automake autoconf libtool glibc make
Install some LNMP -dependent libraries
Yum Install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel FreeType Freetype-devel libxml2 libxml2-devel zlib zlibbzip2bzip2-devel ncurses ncurses- Devel Curl Curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel
It seems that yum can't install libmcrypt after CentOS 6.0 .
Do not solve this problem, compile php,~ ~ ~ Install libmcrypt
TAR-ZXVF libmcrypt-2.5.7.tar.gz
./configure--prefix=/usr/local/libmcrypt
Make && make install
-----------------------------------------------------------------------------------
MAKE[2]: Leaving directory '/USR/LOCAL/SRC/LIBMCRYPT-2.5.7/SRC '
Making All in doc
MAKE[2]: Entering directory '/usr/local/src/libmcrypt-2.5.7/doc '
MAKE[2]: Nothing to is done for ' all '.
MAKE[2]: Leaving directory '/usr/local/src/libmcrypt-2.5.7/doc '
MAKE[2]: Entering directory '/usr/local/src/libmcrypt-2.5.7 '
MAKE[2]: Leaving directory '/usr/local/src/libmcrypt-2.5.7 '
MAKE[1]: Leaving directory '/usr/local/src/libmcrypt-2.5.7 '
-----------------------------------------------------------------------------
It is OK to report this mistake, as long as it is not error , this hint means to leave the current directory.
installation PHP
: http://php.net/downloads.php
TAR-ZXVF php-5.4. + . TAR.GZCD php-5.4. +
./configure--prefix=/usr/local/php --enable---with-mcrypt=/usr/local/--enable-mbstring-- Disable-pdo--with-curl--disable-debug --disable---enable-inline-optimization--with-bz2 -- With-zlib--enable---enable-sysvsem--enable-sysvshm--enable-pcntl--enable---with-mhash-- enable-zip --with-pcre-regex--with-mysql--with---with-gd--with-jpeg-dir
If there is an error reference http://www.cnblogs.com/wangxusummer/p/4094340.html
Make && make install
Add www user Group, add www user, and add www to www user group
-G www www
Copy the php-fpm configuration file
Cp/usr/local/php/etc/php-fpm.conf. default /usr/local/php/etc/php-fpm.conf
Change the configuration file
The preceding semicolon removes The process number generated by the pid for php-fpm
148 149 User group is changed to www .
PID = run/php-== www
Copy Php config file to php default configuration file path
CP Php.ini-production/usr/local/php/lib/php.ini
Ln-s/usr/local/php/bin/php/usr/bin/php
Test
" echo Date (' y-m-d h:i:s '); "
If a time zone error occurs
Change the configuration file
Vim/usr/local/php/etc/php.ini
919 Line, time zone changed to PRC, is the People's Republic of China.
Date.timezone = PRC
installation Nginx
Linux Compilation install PHP Mysql Nginx