Brief introduction:
Environment: Virtual Machine +centos6.6
In the Baidu cloud disk I share the installation package, including LNMP series software.
Http://pan.baidu.com/s/1gdvnimv
1, Pre-installation configuration:
Turn off SELinux (cause I don't know, anyway I do this when I install a lot of software)
Vi/etc/selinux/config
Log off the default ' # ' and add a selinux=disabled
I keep the downloaded package in the/usr/local directory, so if the reader is in the reference document and his own directory is inconsistent, please follow your own directory to modify
Run the Yum library:
Yum install-y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp Curl Curl-devel fontconfig Fontconfig-devel FreeType freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils ke Yutils-libs-devel krb5-devel libcom_err-devel libpng libpng* libpng-devel libjpeg* libsepol-devel libselinux-devel Libstdc++-devel libtool* libgomp libxml2 libxml2-devel libxpm* libx* libtiff libtiff* make MPFR ncurses* ntp OpenSSL nasm nasm* openssl-devel Patch pcre-devel perl php-common php-gd policycoreutils ppl telnet t1lib t1lib* wget zlib-devel
Installation section:
1, installation Yasm
Cd/usr/local/src
Tar zxvf yasm-1.3.0.tar.gz
CD yasm-1.3.0
./configure
Make
Make install
2, Installation Libmcrypt
Cd/usr/local/src
Tar zxvf libmcrypt-2.5.8.tar.gz
CD libmcrypt-2.5.8
./configure
Make
Make install
3, Installation LIBVPX
Cd/usr/local/src
Tar xvf libvpx-v1.3.0.tar.bz2
CD libvpx-v1.3.0
./configure--prefix=/usr/local/libvpx-v1.1.0--enable-shared--ENABLE-VP9
Make
Make install
4. Installing TIFF
Cd/usr/local/src
Tar zxvf tiff-4.0.3.tar.gz
CD tiff-4.0.3
./configure--prefix=/usr/local/tiff-4.0.3--enable-shared
Make
Make install
5, installation Libpng
Cd/usr/local/src
Tar xvf libpng-1.5.6tar.gz
CD libpng-1.5.6
./configure--prefix=/usr/local/libpng-1.5.6--enable-shared
Make
Make install
6, Installation FreeType
Cd/usr/local/src
Tar zxvf freetype-2.5.4.tar.gz
CD freetype-2.5.4
./configure--prefix=/usr/local/freetype-2.5.4--enable-shared
Make #编译
Make install #安装
7. Install JPEG
Cd/usr/local/src
Tar zxvf jpegsrc.v9a.tar.gz
CD jpeg-9a
./configure--prefix=/usr/local/jpeg-9a--enable-shared
Make #编译
Make install #安装
8, installation LIBGD
Cd/usr/local/src
Tar zxvf libgd-2.1.1.tar.gz #解压
CD libgd-2.1.1 #进入目录
./configure--prefix=/usr/local/libgd-2.1.1--enable-shared--with-jpeg=/usr/local/jpeg-9a--with-png=/usr/local/ libpng-1.5.6--with-freetype=/usr/local/freetype-2.5.4--with-fontconfig=/usr/local/freetype-2.5.4--with-xpm=/ usr/--with-tiff=/usr/local/tiff-4.0.3--with-vpx=/usr/local/libvpx-v1.1.0 #配置
Make #编译
Make install #安装
9, installation T1lib
Cd/usr/local/src
Tar zxvf t1lib-5.1.2.tar.gz
CD t1lib-5.1.2
./configure--prefix=/usr/local/t1lib-5.1.2--enable-shared
Make Without_doc
Make install
10. Install PHP
Note: If the system is 64-bit, please execute the following two commands, otherwise the installation of PHP will be wrong (32-bit system does not need to do)
\cp-frp/usr/lib64/libltdl.so*/usr/lib/
\cp-frp/usr/lib64/libxpm.so*/usr/lib/
Cd/usr/local/src
TAR-ZVXF php-5.6.3.tar.gz
CD php-5.6.3
Export Ld_library_path=/usr/local/libgd-2.1.1/lib
./configure --prefix=/usr/local/php-5.6.3--with-config-file-path=/usr/local/php-5.6.3/etc -- with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/ mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir=/usr/local/ libpng-1.5.6--with-jpeg-dir=/usr/local/jpeg-9a --with-freetype-dir=/usr/local/freetype-2.5.4 -- with-xpm-dir=/usr/ --with-vpx-dir=/usr/local/libvpx-v1.1.0/ --with-zlib-dir=/usr/local/zlib-1.2.8 --with-t1lib=/usr/local/t1lib-5.1.2 --with-iconv --enable-libxml --enable-xml -- enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization -- enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp -- enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc -- Enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype #配置
Make #编译
Make install #安装
CP Php.ini-production/etc/php.ini #复制php配置文件到安装目录
Rm-rf/etc/php.ini #删除系统自带配置文件
Ln-s/usr/local/php-5.6.3/etc/php.ini/etc/php.ini #添加软链接到/etc Directory
cp/usr/local/php-5.6.3/sapi/php-fpm.conf.default/usr/local/php-5.6.3/etc/php-fpm.conf #拷贝模板文件为php-fpm configuration file
Ln-s/usr/local/php-5.6.3/etc/php-fpm.conf/etc/php-fpm.conf #添加软连接到/etc Directory
Vi/usr/local/php-5.6.3/etc/php-fpm.conf #编辑
user = www #设置php-fpm run account is www
Group = www #设置php-fpm run Group is www
PID = Run/php-fpm.pid #取消前面的分号
: wq! #保存退出
Set PHP-FPM boot up
CP/USR/LOCAL/PHP-5.6.3/SAPI/FPM/INIT.D.PHP-FPM/ETC/RC.D/INIT.D/PHP-FPM #拷贝php-fpm to startup directory
chmod +x/etc/rc.d/init.d/php-fpm #添加执行权限
Chkconfig PHP-FPM on #设置开机启动
Vi/usr/local/php/etc/php.ini #编辑配置文件
Found:;d Ate.timezone =
Modified to: Date.timezone = PRC #设置时区
Found: Short_open_tag = Off
Modified to: Short_open_tag = on #支持php短标签
Find Opcache.enable=0
Modified to Opcache.enable=1 #php支持opcode缓存
Found in:; Opcache.enable_cli=1 #php支持opcode缓存
Modified to: opcache.enable_cli=0
Added on last line: Zend_extension=opcache.so #开启opcode缓存功能
: wq! #保存退出
Configuring Nginx Support php**************
Vi/usr/local/nginx/conf/nginx.conf #配置修改
User www www; #首行user去掉注释, modify the Nginx run group to www www; must be the same as the User,group configuration in/usr/local/php/etc/php-fpm.conf, or PHP will run in error
Index index.html index.htm index.php; #添加index. php
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
Location ~ \.php$ {
root HTML;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
#取消FastCGI the comment for the Server section location, note the parameters of the Fastcgi_param line, change to $document_root$fastcgi_script_name, or use the absolute path
/etc/init.d/nginx Restart #重启nginx
Service PHP-FPM start #启动php-fpm
cd/usr/local/nginx/html/#进入nginx默认网站根目录
rm-rf/usr/local/nginx/html/* #删除默认测试页
VI index.php #新建index. php file
<?php
Phpinfo ();
?>
: wq! #保存退出
Chown www.www/usr/local/nginx/html/-R #设置目录所有者
chmod 700/usr/local/nginx/html/-R #设置目录权限
If you show a prompt for authorization failure, go directly to the absolute directory to give 777 permissions * * *
Test:
This article refer to the system operation and maintenance revision
centos6.6 compiling and installing the LNMP series PHP