PHP PECL Sphinx 모듈이 설치되지 않습니다

PHP PECL Sphinx 모듈이 설치되지 않습니다

PECL을 사용하여 Debian 7 서버에 PHP Sphinx 클라이언트(PHP 5.6)를 설치하려고 합니다. 이미 Sphinx를 설치했고 /usr/lib에서 라이브러리를 볼 수 있는데도 빌드를 시도할 때 "잘못된 libsphinxclient 버전 또는 lib를 찾을 수 없습니다"라는 잘못된 오류가 발생합니다.

# pecl install sphinx
downloading sphinx-1.3.2.tgz ...
Starting to download sphinx-1.3.2.tgz (15,282 bytes)
.....done: 15,282 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
Please provide the installation prefix of libsphinxclient [autodetect] :
building in /tmp/pear/temp/pear-build-rootAWbWVD/sphinx-1.3.2
running: /tmp/pear/temp/sphinx/configure --with-sphinx
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -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
checking for PHP extension directory... /usr/lib/php5/20131226
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for sphinx support... yes, shared
checking for libsphinxclient headers in default path... found in /usr/local
checking for sphinx_create in -lsphinxclient... no
configure: error: wrong libsphinxclient version or lib not found
ERROR: `/tmp/pear/temp/sphinx/configure --with-sphinx' failed

답변1

Sphinx에는 필수 종속성이 누락되어 있으며 구성 스크립트가 실패 이유를 잘못 해석하고 있습니다. 올바른 버전의 glibc를 설치하면 문제가 해결되었습니다.

제가 받은 오류 메시지와 관련된 Google 조회수가 없었기 때문에 이 글을 게시하게 되었습니다.

문제를 확인하기 위해 다음 절차를 사용했습니다.

~# pecl download sphinx
downloading sphinx-1.3.2.tgz ...
Starting to download sphinx-1.3.2.tgz (15,282 bytes)
.....done: 15,282 bytes
File /root/MP/sphinx-1.3.2.tgz downloaded
~# tar -xf sphinx-1.3.2.tgz
~# cd sphinx-1.3.2/
~/sphinx-1.3.2# phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
~/sphinx-1.3.2# ./configure
[... same output as above ...]
~/sphinx-1.3.2# less config.log
[...]
configure:4059: checking for sphinx_create in -lsphinxclient
configure:4084: cc -o conftest -g -O2  -Wl,-rpath,/usr/local/lib -L/usr/local/lib  -lm conftest.c -lsphinxclient   >&5
/usr/local/lib/libsphinxclient.so: undefined reference to `__fdelt_chk@GLIBC_2.15'
/usr/local/lib/libsphinxclient.so: undefined reference to `memcpy@GLIBC_2.14'
[...]

답변2

나는 같은 문제가 있으며 이것은 Ubuntu 14.04에서 나에게 효과적입니다.

먼저 sphinxsearch를 설치해야 합니다.

sudo apt-get install sphinxsearch sphinxbase-utils libsphinxbase-dev

그런 다음 api libsphinxclient 폴더로 이동하여 설치하십시오.

cd /usr/share/sphinxsearch/api/libsphinxclient
sudo ./configure
sudo make
sudo make install

그런 다음 pecl을 사용하여 스핑크스 클라이언트를 설치할 수 있습니다

sudo pecl install sphinx

설치 후에는 php.ini 파일에 Extension=sphinx.so를 추가하고 아파치 서버를 다시 시작해야 한다는 점을 기억하세요.

관련 정보