如何安裝PHP 5.2的PHP-Curl extension
1,410 total views, 1 views today
前幾天不小心更新了PHP 5.3之後,發現很多的程式都不能跑了,趕緊降回去5.2,但是發現ports已經更新成5.3了,我不會改ports只好下載tgz來裝了。
有兩個方式可以裝
方法一
#cd /tmp #fetch http://www.execve.net/curl/curl-7.20.1.tar.gz #tar -zxvf curl-7.20.1.tar.gz #cd curl-7.20.1 #./configure --prefix=/usr/local/curl #make; make install
然後再重新編譯PHP
#cd /tmp #fetch http://tw.php.net/distributions/php-5.2.13.tar.gz #tar -zxvf php-5.2.13.tar.gz #cd php-5.2.13 #./configure --with-layout=GNU --with-config-file-scan-dir=/usr/local/etc/php --disable-all --enable-libxml --with-libxml-dir=/usr/local --enable-reflection --program-prefix= --disable-path-info-check --with-apxs2=/usr/local/sbin/apxs --with-regex=php --with-zend-vm=CALL --enable-zend-multibyte --disable-ipv6 --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --enable-pcntl --build=i386-portbld-freebsd8.0 --with-curl=/usr/local/curl #apachectl restart
這樣就可以了。
方法二
直接編譯 curl.so
[bash]#fetch http://tw.php.net/distributions/php-5.2.13.tar.gz
#tar -zxvf php-5.2.13.tar.gz
#cd php-5.2.13/ext/curl
#phpize
#./configure –with-curl=DIR
#make
#cp /tmp/php-5.2.13/ext/curl/modules /usr/local/lib/php/extensions/no-debug-non-zts-2006061
#vi /usr/local/etc/php/extensions.ini
extension=curl.so
#apachectl restart[/bash]
收工完成