安装PHP sphinx扩展 sphinx-1.1.0/sphinx.c:105:2: error: too few arguments 错误
表现:
/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开发人员tony2001@php.net的回复,在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.
编辑安装方式简单描述:
- # tar -xzf sphinx-1.1.0.tgz
- # cd sphinx-1.1.0
- # vi sphinx.c
- # ./configure
- # make && make install
相关文章
- PHP对接chatGPT代码,openai接口对接,php 实现chatGPT功能
- iis7上常见的php错误提示有哪些
- 展现魅力:PHP支持MySQL扩展(php支持mysql扩展)
- Linux快速安装PHP的指南(linux一键安装php)
- 版本实现Linux安装多个PHP版本的方法(linux安装多个php)
- Linux系统下如何快速安装PHP(linux命令安装php)
- Linux系统下PHP安装Redis扩展的步骤(php安装redis)
- 安装完美:PHP与MySQL的默契(php和mysql安装)
- PHP在Linux上的安装(php安装linux)
- PHP编程:如何获取和处理MySQL错误信息(php获取mysql错误)
- Linux下PHP的重启操作(php重启.linux)
- 安装Linux实现一键安装PHP环境(linux一键php)
- PHP连接MSSQL数据库的方法和步骤(php如何连接mssql)
- 轻松搞定:PHP安装MSSQL扩展教程(php安装mssql扩展)
- PHP链接MSSQL:解开空白之谜(php链接mssql空白)
- 使用PHP连接远程MSSQL服务器(php连接远程mssql)
- 如何使用Linux 查找安装PHP的位置?(linux查找php)
- PHP开启Redis扩展:实现网站快速加载(php开启redis扩展)
- 在PHP中安装MySQL扩展:一步一步操作指引(php安装mysql扩展)
- php-accelerator网站加速PHP缓冲的方法
- php连接Access数据库错误及解决方法
- PHP编译安装中遇到的两个错误和解决方法
- Windows下PHP安装路径配置错误导致Apache无法启动的解决方法