PHP installation
1. Download related files of this document
Second, php installation
1. Download related files of this document
1. php download address: http://php.net/downloads.php
(Note: The php version downloaded in this document is php-5.6.11.tar.gz)
2. The test machine system is CentOS release 6.3 (Final)
Second, php installation
1. Install php
a. Unzip the compressed file tar –zxf php-5.6.11.tar.gz
b. After entering the decompression directory, execute
./configure --prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql--enable-fpm --enable-xml --enable-soap --enable-mbstring --enable-sockets--with-curl --enable-zip --enable-ftp --with-gd --with-bz2--with-openssl --with-zlib --with-mhash --enable-exif --enable-sockets--enable-mbstring --enable-xml --enable-fpm --enable-soap --with-gd --with-curl--with-mcrypt=/usr/local/libmcrypt --with-imap --with-imap-ssl --with-jpeg-dir--with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf--enable-gd-jis-conv --with-kerberos
c. Compile and install make && make install
2. Start php
a. Copy the php.ini file
[root@hadoop phpsrc]# cpphp.ini-production /usr/local/php/etc/php.ini
b. Start php-fpm
[root@hadoop etc]# cpphp-fpm.conf.default php-fpm.conf
[root@hadoop php]# ./sbin/php-fpm
c. Check the php-fpm port
3. Test php
4. Common exceptions and handling
error one
checking libxml2 installdir... no
checking for xml2-configpath...
configure: error:xml2-config not found. Please check your libxml2 installation.
solution
yum install libxml2
yum install libxml2-devel
error two
configure: error: Cannot find OpenSSL's<evp.h>
solution
yum install openssl-devel
error three
checking for BZip2 in default path...not found
configure: error: Please reinstall theBZip2 distribution
solution
yum install bzip2-devel
error four
checking for cURL in default path...not found
configure: error: Please reinstall thelibcurl distribution -
easy.h should be in<curl-dir>/include/curl/
solution
yum install libcurl libcurl-devel
error five
If configure fails try--with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.
solution
yum install libjpeg libpng freetypelibjpeg-devel libpng-devel freetype-devel
error six
configure: error: utf8_mime2text() hasnew signature, but U8T_CANONICAL is missing. This should not happen. Checkconfig.log for additional information
solution
yum install libc-client-devel
error seven
configure: error: This c-client libraryis built with Kerberos support.
Add --with-kerberos to your configureline. Check config.log for details.
solution
Add --with-kerberos to ./configure
error eight
configure: error: mcrypt.h not found.Please reinstall libmcrypt.
solution
yum install libmcrypt or
Download libmcrypt package
(编译安装 ./configure --prefix=/usr/local/libmcrypt make && make install)