Environment:
Ubuntu 14.04 php5.59 MySQL 5.5
1. Download the Sphinx extension Http://pecl.php.net/package/sphinx Select the desired version, then unzip and execute
root@iz282i5hw2tz:~/sphinx-1.1.0#/usr/bin/phpizeconfiguring for:php API Version: 20121113Zend Module API No: 20121212Zend Extension Api No:
2. Installing Libsphinxclient
root@iz282i5hw2tz:~/coreseek-3.2.14/csft-3.2.14/api/libsphinxclient#./configure
root@iz282i5hw2tz:~/coreseek-3.2.14/csft-3.2.14/api/libsphinxclient# make && make install
3. Installing the Sphinx module
root@iz282i5hw2tz:~/sphinx-1.1.0#./configure--with-php-config=/usr/bin/php-config--with-sphinx
root@iz282i5hw2tz:~/sphinx-1.1.0# make/bin/bash/root/sphinx-1.1.0/libtool--mode=compile cc-i.-I/root/ sphinx-1.1.0-dphp_atom_inc-i/root/sphinx-1.1.0/include-i/root/sphinx-1.1.0/main-i/root/sphinx-1.1.0-i/usr/ include/php5-i/usr/include/php5/main-i/usr/include/php5/tsrm-i/usr/include/php5/zend-i/usr/include/php5/ext-i/ Usr/include/php5/ext/date/lib-i/usr/local/include-dhave_config_h-g-o2-c/root/sphinx-1.1.0/sphinx.c-o Sphinx.lo Libtool:compile:cc-i.-i/root/sphinx-1.1.0-dphp_atom_inc-i/root/sphinx-1.1.0/include-i/root/sphinx-1.1.0/main-i /root/sphinx-1.1.0-i/usr/include/php5-i/usr/include/php5/main-i/usr/include/php5/tsrm-i/usr/include/php5/zend- I/usr/include/php5/ext-i/usr/include/php5/ext/date/lib-i/usr/local/include-dhave_config_h-g-o2-c/root/ Sphinx-1.1.0/sphinx.c-fpic-dpic-o. libs/sphinx.o/root/sphinx-1.1.0/sphinx.c:in function ' Php_sphinx_client_read_ Property ':/root/sphinx-1.1.0/sphinx.c:105:2: Error:too few arguments to function ' std_hnd->read_property ' retval = Std_hnd->read_property (object, member, type TSRMLS_CC); ^/root/sphinx-1.1.0/sphinx.c:in function ' zim_sphinxclient_updateattributes ':/root/sphinx-1.1.0/sphinx.c:1040:6: warning:passing argument 2 of ' memset ' makes integer from pointer without a cast [enabled by default] memset (VALS_MV A, NULL, values_mva_size); ^in file included from/usr/include/features.h:374:0, from/usr/include/stdlib.h:24, from /usr/include/php5/main/php_config.h:2418, from/usr/include/php5/main/php.h:33, From/root /sphinx-1.1.0/sphinx.c:26:/usr/include/x86_64-linux-gnu/bits/string3.h:76:1: note:expected ' int ' but argument is of Type ' void * ' __nth (memset (void *__dest, int __ch, size_t __len)) ^/root/sphinx-1.1.0/sphinx.c:in function ' Zm_startup_ Sphinx ':/root/sphinx-1.1.0/sphinx.c:1888:43:warning:assignment from incompatible pointer type [enabled by default] php _sphinx_client_handlers.read_propeRty = Php_sphinx_client_read_property; ^make: * * * [Sphinx.lo] Error 1
Here is an error, modify SPHINX.C 105th behavior:
retval = Std_hnd->read_property (object, member, type TSRMLS_CC, NULL);
It can then be compiled by
4 Edit PHP.ini
Extension=sphinx.so