CentOS Installation PHP PHP-FPM
1. Download PHP Source Package
http://www.php.net/downloads.php
2. Install PHP
TAR-XVF php-5.5.13.tar.bz2
CD php-5.5.13
./configure--prefix=/usr/local/php--with-config-file-path=/etc--enable-inline-optimization--disable-debug-- Disable-rpath--enable-shared--enable-opcache--enable-fpm--with-fpm-user=www--with-fpm-group=www--with-mysql= Mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-gettext--enable-mbstring--with-iconv--with-mcrypt-- With-mhash--with-openssl--enable-bcmath--enable-soap--with-libxml-dir--enable-pcntl--enable-shmop-- Enable-sysvmsg--enable-sysvsem--enable-sysvshm--enable-sockets--with-curl--with-zlib--enable-zip--with-bz2-- With-readline--without-sqlite3--without-pdo-sqlite--with-pear
Error occurred: Congigure error:xml2-config not found.
Workaround:
Execute command: sudo yum install Libxml2-devel
To see if it was successful: Find/-name "Xml2-config"
Error occurred: Congigure error:cannot find OpenSSL ' s <evp.h>
Workaround:
Yum Install OpenSSL Openssl-devel
Ln-s/usr/lib64/libssl.so/usr/lib/
Error occurred: Configure:error:Please Reinstall the BZIP2 distribution
Workaround: Yum Install bzip2 Bzip2-devel
Error occurred: Configure:error:Please Reinstall the Libcurl distribution-easy.h should be in <curl-dir>/include/curl/
Workaround: Yum-y Install Curl-devel
Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
sudo yum install libmcrypt libmcrypt-devel mcrypt Mhash
Configure:error:Please Reinstall Readline-i Cannot find readline.h
sudo yum install Readline-devel
Make
Make install
If prompted make: * * [Ext/fileinfo/libmagic/apprentice.lo] Error 1. /configure after adding--disable-fileinfo, again./configure.
If make: [sapi/cli/php] Error 1 Modify makefile in extra_libs = Last add-liconv and then re-make again.
Adding PHP commands to environment variables
Vim/etc/profile
Join at the end
Path= $PATH:/usr/local/php/bin
Export PATH
To make the change take effect immediately execution
. /etc/profile or Source/etc/profile
View environment variables
Echo $PATH
View PHP Version
Php-v
PHP 5.5.13 (CLI) (Built:jun 20 2014 11:11:26)
Copyright (c) 1997-2014 the PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Configure PHP-FPM
Cd/usr/local/php/etc
CP Php-fpm.conf.default php-fpm.conf
Start PHP-FPM
sudo/usr/local/php/sbin/php-fpm
Install PHP php-fpm under Linux (reprint)