linux + php 安裝curl

作者:憶茶篍

linux + php 安裝curl
進入安裝原php的源碼目錄,

cd ext

cd curl

/usr/local/php5/bin/phpize  在源碼目錄裏執行此行代碼纔會有用 此目錄爲php的安裝目錄

./configure --with-php-config=/usr/local/php5/bin/php-config  --with-curl=/usr/local/curl

執行此行代碼 可能會報錯 

configure: error: Please reinstall the libcurl distribution 

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/



其實就是curl的dev包沒有安裝, 解決方案:
終端下

# yum -y install curl-devel

然後

make & make install

就會在

/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
下生成curl.so的文件。

修改php.ini就好了

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/curl.so

# /usr/local/apache2/bin/apachectl start

到此成功了,在phpinfo中可以看到CURL的項。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章