安裝PHP sphinx擴充 sphinx-1.1.0/sphinx.c:105:2: error: too few arguments 錯誤

來源:互聯網
上載者:User

標籤:分享   ber   官網   its   錯誤   type   and   cat   發布   

表現:

/home/sphinx-1.1.0/sphinx.c: In function ‘php_sphinx_client_read_property’:
/home/sphinx-1.1.0/sphinx.c:105:2: error: too few arguments to function ‘std_hnd->read_property’
/home/sphinx-1.1.0/sphinx.c: In function ‘zim_SphinxClient_updateAttributes’:
/home/sphinx-1.1.0/sphinx.c:1040:6: warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:77:1: note: expected ‘int’ but argument is of type ‘void *’
/home/sphinx-1.1.0/sphinx.c: In function ‘zm_startup_sphinx’:
/home/sphinx-1.1.0/sphinx.c:1888:43: warning: assignment from incompatible pointer type [enabled by default]

sphinx-1.1.0/sphinx.c:105:2: error: too few arguments

 

解決

之前在PHP 5.2.16以及5.3.17環境下安裝PECL擴充sphinx-1.1.0時,均成功.但今日在PHP 5.4.10環境下

安裝sphinx-1.1.0時,卻遇到錯誤.

      遇到的錯誤在PHP官網上作為bug由其他使用者反應了,見

      https://bugs.php.net/bug.php?id=61241

 

      解決方式:

      1.來自PHP開發人員[email protected]的回複,在SVN發布的PHP更新源碼中進行了修複.

       回複時間是: 2012-06-12 19:17 UTC

       因為所使用的PHP是採用伺服器系統安裝的,因此此方式不適合.

      2.參照回複者andrew at cbtech dot co dot uk的回複,對sphinx-1.1.0的源碼修改,再進行編譯安裝.

      下面是其回複內容:

If you change line 105 of sphinx.c from:
retval = std_hnd->read_property(object, member, type TSRMLS_CC);
to 
retval = std_hnd->read_property(object, member, type TSRMLS_CC, NULL);
it compiles and seems to work.

 

      編輯安裝方式簡單描述:

    1. # tar -xzf sphinx-1.1.0.tgz  
    2. # cd sphinx-1.1.0  
    3. # vi sphinx.c  
    4. # ./configure  
    5. # make && make install 
   好文要頂 關注我 收藏該文  

安裝PHP sphinx擴充 sphinx-1.1.0/sphinx.c:105:2: error: too few arguments 錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.