Linux-重装系统之PHP安装
1.编译安装没有疑问:
tar zxvf php-5.2.14.tar.gz
gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1
cd php-5.2.14/
./configure
--prefix=/usr/local/webserver/php
--with-config-file-path=/usr/local/webserver/php/etc
--with-mysql=/usr/local/webserver/mysql
--with-mysqli=/usr/local/webserver/mysql/bin/mysql_config
--with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir
--with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml
--disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath
--enable-shmop --enable-sysvsem --enable-inline-optimization
--with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi
--enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt
--with-gd --enable-gd-native-ttf --with-openssl --with-mhash
--enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl
--with-xmlrpc --enable-zip --enable-soap
配置,提示错误:error:XML configuration could not be found(http://linyaquan.blog.51cto.com/3405807/775679)
解决方案:
yum -y install libxml2 libxml2-devel
再次配置: 提示错误:error: Cannot find OpenSSL's <evp.h> (http://blog.csdn.net/alexdream/article/details/7408561)
yum install openssl openssl-devel
ln -s /usr/lib64/libssl.so /usr/lib/
再次配置:提示错误:configure: error: Please reinstall the libcurl distribution (http://lxsym.blog.51cto.com/1364623/454291)
其实就是curl的dev包没有安装, 解决方案:
yum -y install curl-devel
再次配置:提示错误:configure: error: libjpeg.(a|so) not found (http://zhizhuofl.blog.163.com/blog/static/6991477920111781424159)
解决方案:
yum install libjpeg-devel
再次配置:提示错误:configure: error: libpng.(a|so) not found
解决方案:
yum install libpng-devel
再次配置:提示错误:configure: error: freetype.h not found (http://forums.fedoraforum.org/showthread.php?t=158039)
解决方案:
yum install freetype-devel
再次配置:提示错误: configure: error: Cannot find ldap.h(http://linyaquan.blog.51cto.com/3405807/775695)
解决方案 :
yum install openldap
yum install openldap-devel
终于配置成功
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-dist /usr/local/webserver/php/etc/php.ini
cd ../
2.编译安装PHP5扩展模块
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1/
/usr/local/webserver/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql
make
make install
cd ../
tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.5.1-2/
./configure
make
make install
cd ../
tar zxvf imagick-2.3.0.tgz
cd imagick-2.3.0/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../
浙公网安备 33010602011771号