php安裝curl問題

來源:互聯網
上載者:User

標籤:伺服器   php   拓展   curl   

    這兩天在伺服器為php安裝curl拓展是遇到一個問題。很是糾結了一下...

    系統是centos 6.4 64位系統,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: 在函數‘curl_write’中:
/php-5.3.3/ext/curl/interface.c:930: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數‘curl_progress’中:
/php-5.3.3/ext/curl/interface.c:1006: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數‘curl_read’中:
/php-5.3.3/ext/curl/interface.c:1080: 錯誤:‘zend_fcall_info’沒有名為‘object_ptr’的成員
/php-5.3.3/ext/curl/interface.c: 在函數‘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查看是發現如下報錯:
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。嘗試多種方法無解後,無意看到國外一個網站上寫的"yum install xxx",在自己伺服器嘗試yum install php-curl後,再次使用php -v已經沒有上述錯誤了。

之後重啟nginx和php,curl拓展已經可以正常使用。

    有時候遇到錯誤,一個思路走不通的話,可以換個思路,往往就是很簡單的一條命令就解決了問題。

    


本文出自 “葉落花開” 部落格,請務必保留此出處http://linus1521.blog.51cto.com/1216391/1431515

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.