這兩天在服務(wù)器為php安裝curl拓展是遇到一個問題。很是糾結(jié)了一下...

成都創(chuàng)新互聯(lián)公司網(wǎng)絡(luò)公司擁有10多年的成都網(wǎng)站開發(fā)建設(shè)經(jīng)驗,上千客戶的共同信賴。提供網(wǎng)站設(shè)計、做網(wǎng)站、網(wǎng)站開發(fā)、網(wǎng)站定制、友情鏈接、建網(wǎng)站、網(wǎng)站搭建、自適應(yīng)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計師打造企業(yè)風格,提供周到的售前咨詢和貼心的售后服務(wù)
系統(tǒng)是centos 6.4 64位系統(tǒng),php版本5.3.3,因需要安裝curl拓展,但是使用5.3.3的源碼包安裝curl拓展時make報錯:/php-5.3.3/ext/curl/interface.c:319: 警告:初始化丟棄了指針目標類型的限定
/php-5.3.3/ext/curl/interface.c: 在函數(shù)‘curl_write’中:
/php-5.3.3/ext/curl/interface.c:930: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數(shù)‘curl_progress’中:
/php-5.3.3/ext/curl/interface.c:1006: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數(shù)‘curl_read’中:
/php-5.3.3/ext/curl/interface.c:1080: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數(shù)‘curl_write_header’中:
/php-5.3.3/ext/curl/interface.c:1157: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
make: *** [interface.lo] 錯誤 1
--------------------------------------------
后使用php5.2.17版本源碼包安裝了curl拓展。
#cd php-5.2.17/ext/curl
#/usr/local/php/bin/phpize
#./configure --with-curl=/usr/local/curl/ --with-php-config=/usr/local/php/bin/php-config
#make
#make test
#make install
然后在php.ini文件添加:
【curl】
extension = "curl.so"
---------------------------------------------------
但是使用php -v查看是發(fā)現(xiàn)如下報錯:
PHP Warning: PHP Startup: curl: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: curl: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP 5.3.3 (cli) (built: Jul 12 2013 20:35:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
錯誤信息是說php版本和模塊版本不兼容,然后就一直在查找資料怎樣match。嘗試多種方法無解后,無意看到國外一個網(wǎng)站上寫的"yum install xxx",在自己服務(wù)器嘗試yum install php-curl后,再次使用php -v已經(jīng)沒有上述錯誤了。
之后重啟nginx和php,curl拓展已經(jīng)可以正常使用。
有時候遇到錯誤,一個思路走不通的話,可以換個思路,往往就是很簡單的一條命令就解決了問題。
網(wǎng)頁名稱:php安裝curl問題
網(wǎng)頁網(wǎng)址:http://chinadenli.net/article28/pgjgjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、品牌網(wǎng)站建設(shè)、企業(yè)網(wǎng)站制作、軟件開發(fā)、虛擬主機、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)