您好,登錄后才能下訂單哦!
作者:憶茶篍
linux + php 安裝curl
進(jìn)入安裝原php的源碼目錄,
cd ext
cd curl
/usr/local/php5/bin/phpize 在源碼目錄里執(zhí)行此行代碼才會有用 此目錄為php的安裝目錄
./configure --with-php-config=/usr/local/php5/bin/php-config --with-curl=/usr/local/curl
執(zhí)行此行代碼 可能會報(bào)錯(cuò)
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/
其實(shí)就是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的項(xiàng)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。