溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

linux + php 安裝curl

發(fā)布時(shí)間:2020-08-11 20:46:07 來源:網(wǎng)絡(luò) 閱讀:431 作者:rangercat 欄目:web開發(fā)

作者:憶茶篍

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)。

向AI問一下細(xì)節(jié)

免責(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)容。

AI