Compiling and installing php5.6.4
First, prepare the source package
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php1.png "width=" 660 "height=" "alt=", "Php1.png"/>
The version 5.6.4 is used here, for PHP5.3 and above, in order to link the MySQL database, you can specify MYSQLND, so that you do not need to install the MySQL or MySQL development package. Mysqlnd from PHP
3 is available and can be bound to it at compile time (instead of relying on a specific MySQL client library binding), but starting with PHP 5.4 It is the default setting.
[Email protected] ~]# tar xf php-5.6.4.tar.xz [[email protected] ~]# CD php-5.6.4 [[email protected] php-5.6.4]#. Configure--PREFIX=/USR/LOCAL/PHP--WITH-MYSQL=MYSQLND--with-mysqli=mysqlnd--with-pdo-mysql= Mysqlnd--with-openssl--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib-- WITH-LIBXML-DIR=/USR--enable-xml--enable-sockets--with-mcrypt--with-config-file-path=/etc-- WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2--enable-maintainer-zts--enable-fpm[[email protected] php-5.6.4]# Make[[email protected] php-5.6.4]# make install
Compile time will be longer
Second, configure PHP
[[email protected] php-5.6.4]# CP Php.ini-production/etc/php.ini//provide a configuration file for PHP
provide the SysV init script for php-fpm and add it to the list of services and indicate the installation path,php-fpm program path, configuration file path, and pid file path
[[email protected] php-5.6.4]# CP sapi/fpm/init.d.php-fpm/etc/rc.d/init.d/php-fpm[[email protected] php-5.6.4]# chmod +x/etc/rc.d/init.d/php-fpm[[email protected] php-5.6.4]# chkconfig--add php-fpm[[email protected] php-5.6.4]# Chkconfig PHP-FPM on
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php2.png "width=" 660 "height=" "" alt= "Php2.png"/> "
to provide a configuration file for PHP-FPM:
[Email protected] php-5.6.4]# cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
to edit a php-fpm configuration file:
[Email protected] php-5.6.4]# vim/usr/local/php/etc/php-fpm.conf
Configure The relevant options for FPM to the value you need, and enable the PID file to modify the listening IP address port (the last line below):
Pm.max_children = 50pm.start_servers = 5pm.min_spare_servers = 2pm.max_spare_servers = 8pid =/usr/local/php/var/run/ Php-fpm.pid
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php3.png "width=" 660 "height=" "alt= [Php3.png]/>"
now it's time to test if PHP-FPM can start.
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php4.png "width=" 660 "height=" + "alt=" Php4.png "/>
Enable success
NFS File System
Implementing the program Nfs-utils
[email protected] ~]# Yum install-y nfs-utils
Start Service Script
[[Email protected] ~]# Service NFS Start
View post-Boot ports
[Email protected] ~]# rpcinfo–p
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php5.png "width=" 660 "height=" 295 "alt=" Php5.png "/>
NFS uses 2049 ports,mountd uses random ports
Configuration Nfs
edit /etc/exports file, one file system per behavior
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php9.png "width=" 660 "height=" Notoginseng "border=" 0 "hspace=" 0 "vspace=" 0 "title=" "style=" WIDTH:660PX;HEIGHT:37PX; "alt=" Php9.png "/>
the first one in each row IP is the HTTP host the second IP for the PHP host, two servers respectively authorized, RW for read and Write permissions,No_root_squash means mount
The client of this file system has root privileges so that later mount access
Here we Create two directories for the following site WordPress and phpMyAdmin
[[email protected] wp]# MKDIR/WEB/VHOSTS/{WP,PMA}
Restart Service
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php7.png "width=" 660 "height=" 202 "alt=" Php7.png "/>
Showmount–e can view the currently mounted file system
650) this.width=650; "src=" Http://l51cto.qiniudn.com/php8.png "width=" 660 "height=" 126 "alt=" Php8.png "/>
This article is from the "Linux Learning path" blog, so be sure to keep this source http://linuxu.blog.51cto.com/9471357/1597006
Lamp+nfs compile and install PHP with NFS file system