./configure --prefix=/usr/local/php --enable-fpm --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --enable-pdo --with-pdo-mysql --with-gettext --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --enable-zip --enable-freetype --with-libxml-dir=/usr/local/libxml2 --with-zlib-dir=/usr/local/zlib --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/png --prefix=/usr/local/php --with-apxs2=/usr/local/myapache/bin/apxs --disable-fileinfo --with-mysql=shared,mysqlnd
yum install libxml2 libxml2-devel
让apache 能执行PHP后缀
在apache配置文件里加上
AddType application/x-httpd-php.php
编译PHP5.5 make 时出现错误
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
解决办法
这是由于内存小于1G所导致.
在./configure加上选项:
--disable-fileinfo
Disable fileinfo support 禁用 fileinfo