python html5 bootstrap 视频教程

德云社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 6262|回复: 2

在 Ubuntu Server 14.04 下以 pecl 方式安装 PHP5 的 Sphinx 1.3.2 扩展

[复制链接]

20

主题

42

帖子

153

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
91
金币
2
威望
0
贡献
0
发表于 2015-1-3 12:02:45 | 显示全部楼层 |阅读模式
AI人工智能 语音助理 人工翻译 教程

Sphinx 是一个基于 SQL 的全文检索引擎,可以结合 MySQLMariaDBPostgreSQL 做全文搜索。它能提供比数据库本身更专业的搜索功能,使得应用程序更容易实现专业化的全文检索Sphinx 特别为一些脚本语言设计了搜索 API 接口,譬如:PHPPythonPerlRuby 等,同时还为 MySQL 设计了一个存储引擎插件。


SphinxSQL Phrase Index 的缩写,但不幸的是和 CMUSphinx 项目重名。


Sphinx 单一索引最大可包含 1 亿条记录,在 1 千万条记录情况下的查询速度为 0.x 秒毫秒级)。Sphinx 创建索引的速度,譬如:创建 100 万条记录的索引只需 3~4 分钟,创建 1000 万条记录的索引可在 50 分钟内完成,而只包含最新 10 万条记录的增量索引,重建一次只需几十秒。


应用程序可通过 3 种不同接口方式与 Sphinx 搜索服务 (searchd) 通信:

1、通过原生搜索 API (SphinxAPI);


2、通过 Sphinx 自身支持的 MySQL 网络协议 (使用命名为 SphinxQLSQL 精简子集);


3、通过 MySQL 服务端存储插件引擎 (SphinxSE);


当然, 还可通过使用 1、2、3 的应用程序构建 Web Service 为其他应用程序提供通信。


若想全文检索中文,可考虑使用 Coreseek


01、以 pecl 方式直接安装 Sphinx 1.3.2
  1. root:# pecl install sphinx
  2. downloading sphinx-1.3.2.tgz ...
  3. Starting to download sphinx-1.3.2.tgz (15,282 bytes)
  4. .....done: 15,282 bytes
  5. 4 source files, building
  6. running: phpize
  7. Configuring for:
  8. PHP Api Version:         20121113
  9. Zend Module Api No:      20121212
  10. Zend Extension Api No:   220121212
  11. Please provide the installation prefix of libsphinxclient [autodetect] : /usr/local/libsphinxclient    #libsphinxclient 前缀
  12. building in /tmp/pear/temp/pear-build-rootQpH1re/sphinx-1.3.2
  13. running: /tmp/pear/temp/sphinx/configure --with-sphinx=/usr/local/libsphinxclient
  14. checking for grep that handles long lines and -e... /bin/grep
  15. checking for egrep... /bin/grep -E
  16. checking for a sed that does not truncate output... /bin/sed
  17. checking for cc... cc
  18. checking whether the C compiler works... yes
  19. checking for C compiler default output file name... a.out
  20. checking for suffix of executables...
  21. checking whether we are cross compiling... no
  22. checking for suffix of object files... o
  23. checking whether we are using the GNU C compiler... yes
  24. checking whether cc accepts -g... yes
  25. checking for cc option to accept ISO C89... none needed
  26. checking how to run the C preprocessor... cc -E
  27. checking for icc... no
  28. checking for suncc... no
  29. checking whether cc understands -c and -o together... yes
  30. checking for system library directory... lib
  31. checking if compiler supports -R... no
  32. checking if compiler supports -Wl,-rpath,... yes
  33. checking build system type... x86_64-unknown-linux-gnu
  34. checking host system type... x86_64-unknown-linux-gnu
  35. checking target system type... x86_64-unknown-linux-gnu
  36. checking for PHP prefix... /usr
  37. 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
  38. checking for PHP extension directory... /usr/lib/php5/20121212
  39. checking for PHP installed headers prefix... /usr/include/php5
  40. checking if debug is enabled... no
  41. checking if zts is enabled... no
  42. checking for re2c... no
  43. configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
  44. checking for gawk... no
  45. checking for nawk... nawk
  46. checking if nawk is broken... no
  47. checking for sphinx support... yes, shared
  48. checking for libsphinxclient headers in /usr/local/libsphinxclient... not found
  49. configure: error: Cannot find libsphinxclient headers    #错误提示:安装过程中出现问题
  50. ERROR: `/tmp/pear/temp/sphinx/configure --with-sphinx=/usr/local/libsphinxclient' failed    #错误提示:安装过程中出现问题
  51. root:#
复制代码
02、修复 libsphinxclient 错误提示
  1. root:# cd /var/coreseek-4.1-beta/testpack/api/libsphinxclient
  2. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient# ./configure --prefix=/usr/local/libsphinxclient    #配置 libsphinxclient
  3. checking for a BSD-compatible install... /usr/bin/install -c
  4. checking whether build environment is sane... yes
  5. checking for gawk... no
  6. checking for mawk... mawk
  7. checking whether make sets $(MAKE)... yes
  8. checking whether to enable maintainer-specific portions of Makefiles... no
  9. checking for gcc... gcc
  10. checking for C compiler default output file name... a.out
  11. checking whether the C compiler works... yes
  12. checking whether we are cross compiling... no
  13. checking for suffix of executables...
  14. checking for suffix of object files... o
  15. checking whether we are using the GNU C compiler... yes
  16. checking whether gcc accepts -g... yes
  17. checking for gcc option to accept ANSI C... none needed
  18. checking for style of include used by make... GNU
  19. checking dependency style of gcc... none
  20. checking for a sed that does not truncate output... /bin/sed
  21. checking build system type... x86_64-unknown-linux-gnu
  22. checking host system type... x86_64-unknown-linux-gnu
  23. checking for egrep... grep -E
  24. checking for ld used by gcc... /usr/bin/ld
  25. checking if the linker (/usr/bin/ld) is GNU ld... yes
  26. checking for /usr/bin/ld option to reload object files... -r
  27. checking for BSD-compatible nm... /usr/bin/nm -B
  28. checking whether ln -s works... yes
  29. checking how to recognise dependent libraries... pass_all
  30. checking how to run the C preprocessor... gcc -E
  31. checking for ANSI C header files... yes
  32. checking for sys/types.h... yes
  33. checking for sys/stat.h... yes
  34. checking for stdlib.h... yes
  35. checking for string.h... yes
  36. checking for memory.h... yes
  37. checking for strings.h... yes
  38. checking for inttypes.h... yes
  39. checking for stdint.h... yes
  40. checking for unistd.h... yes
  41. checking dlfcn.h usability... yes
  42. checking dlfcn.h presence... yes
  43. checking for dlfcn.h... yes
  44. checking how to run the C++ preprocessor... /lib/cpp
  45. checking the maximum length of command line arguments... 32768
  46. checking command to parse /usr/bin/nm -B output from gcc object... failed
  47. checking for objdir... .libs
  48. checking for ar... ar
  49. checking for ranlib... ranlib
  50. checking for strip... strip
  51. checking if gcc static flag  works... yes
  52. checking if gcc supports -fno-rtti -fno-exceptions... no
  53. checking for gcc option to produce PIC... -fPIC
  54. checking if gcc PIC flag -fPIC works... yes
  55. checking if gcc supports -c -o file.o... yes
  56. checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
  57. checking whether -lc should be explicitly linked in... no
  58. checking dynamic linker characteristics... GNU/Linux ld.so
  59. checking how to hardcode library paths into programs... immediate
  60. checking whether stripping libraries is possible... yes
  61. checking if libtool supports shared libraries... yes
  62. checking whether to build shared libraries... yes
  63. checking whether to build static libraries... yes
  64. configure: creating libtool
  65. appending configuration tag "CXX" to libtool
  66. appending configuration tag "F77" to libtool
  67. checking for a BSD-compatible install... /usr/bin/install -c
  68. checking for size_t... yes
  69. checking for string.h... (cached) yes
  70. checking for strings.h... (cached) yes
  71. checking for unistd.h... (cached) yes
  72. checking for stdint.h... (cached) yes
  73. configure: creating ./config.status
  74. config.status: creating Makefile
  75. config.status: creating sphinxclient_config.h
  76. config.status: executing depfiles commands
  77. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient#
复制代码
03、编译、安装 libsphinxclient
  1. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient# make && make install    #编译、安装 libsphinxclient
  2. make  all-am
  3. make[1]: 正在进入目录 `/var/coreseek-4.1-beta/testpack/api/libsphinxclient'
  4. /bin/bash ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c -o sphinxclient.lo sphinxclient.c
  5. mkdir .libs
  6. gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c sphinxclient.c  -fPIC -DPIC -o .libs/sphinxclient.o
  7. gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c sphinxclient.c -o sphinxclient.o >/dev/null 2>&1
  8. /bin/bash ./libtool --mode=link --tag=CC gcc  -g -O2   -o libsphinxclient.la -rpath /usr/local/libsphinxclient/lib -release 0.0.1 sphinxclient.lo  
  9. gcc -shared  .libs/sphinxclient.o   -Wl,-soname -Wl,libsphinxclient-0.0.1.so -o .libs/libsphinxclient-0.0.1.so
  10. (cd .libs && rm -f libsphinxclient.so && ln -s libsphinxclient-0.0.1.so libsphinxclient.so)
  11. ar cru .libs/libsphinxclient.a  sphinxclient.o
  12. ranlib .libs/libsphinxclient.a
  13. creating libsphinxclient.la
  14. (cd .libs && rm -f libsphinxclient.la && ln -s ../libsphinxclient.la libsphinxclient.la)
  15. gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c test.c
  16. test.c: In function ‘test_status’:
  17. test.c:296:22: warning: incompatible implicit declaration of built-in function ‘strstr’ [enabled by default]
  18.    if ( !g_smoke || ( strstr ( status[k], "time" )==NULL && strstr ( status[k], "wall" )==NULL ) )
  19.                       ^
  20. test.c: In function ‘title’:
  21. test.c:341:2: warning: ' ' flag used with ‘%s’ gnu_printf format [-Wformat=]
  22.   printf ( "-> % s <-\n\n", name );
  23.   ^
  24. /bin/bash ./libtool --mode=link --tag=CC gcc  -g -O2   -o test  test.o .libs/libsphinxclient.a
  25. gcc -g -O2 -o test test.o  .libs/libsphinxclient.a
  26. make[1]:正在离开目录 `/var/coreseek-4.1-beta/testpack/api/libsphinxclient'
  27. make[1]: 正在进入目录 `/var/coreseek-4.1-beta/testpack/api/libsphinxclient'
  28. test -z "/usr/local/libsphinxclient/lib" || mkdir -p -- "/usr/local/libsphinxclient/lib"
  29. /bin/bash ./libtool --mode=install /usr/bin/install -c -s 'libsphinxclient.la' '/usr/local/libsphinxclient/lib/libsphinxclient.la'
  30. /usr/bin/install -c .libs/libsphinxclient-0.0.1.so /usr/local/libsphinxclient/lib/libsphinxclient-0.0.1.so
  31. strip --strip-unneeded /usr/local/libsphinxclient/lib/libsphinxclient-0.0.1.so
  32. (cd /usr/local/libsphinxclient/lib && rm -f libsphinxclient.so && ln -s libsphinxclient-0.0.1.so libsphinxclient.so)
  33. /usr/bin/install -c .libs/libsphinxclient.lai /usr/local/libsphinxclient/lib/libsphinxclient.la
  34. /usr/bin/install -c .libs/libsphinxclient.a /usr/local/libsphinxclient/lib/libsphinxclient.a
  35. strip --strip-debug /usr/local/libsphinxclient/lib/libsphinxclient.a
  36. ranlib /usr/local/libsphinxclient/lib/libsphinxclient.a
  37. chmod 644 /usr/local/libsphinxclient/lib/libsphinxclient.a
  38. PATH="$PATH:/sbin" ldconfig -n /usr/local/libsphinxclient/lib
  39. ----------------------------------------------------------------------
  40. Libraries have been installed in:
  41.    /usr/local/libsphinxclient/lib

  42. If you ever happen to want to link against installed libraries
  43. in a given directory, LIBDIR, you must either use libtool, and
  44. specify the full pathname of the library, or use the `-LLIBDIR'
  45. flag during linking and do at least one of the following:
  46.    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  47.      during execution
  48.    - add LIBDIR to the `LD_RUN_PATH' environment variable
  49.      during linking
  50.    - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  51.    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

  52. See any operating system documentation about shared libraries for
  53. more information, such as the ld(1) and ld.so(8) manual pages.
  54. ----------------------------------------------------------------------
  55. test -z "/usr/local/libsphinxclient/include" || mkdir -p -- "/usr/local/libsphinxclient/include"
  56. /usr/bin/install -c -m 644 'sphinxclient.h' '/usr/local/libsphinxclient/include/sphinxclient.h'
  57. make[1]:正在离开目录 `/var/coreseek-4.1-beta/testpack/api/libsphinxclient'
  58. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient#
复制代码
04、再次以 pecl 方式直接安装 Sphinx 1.3.2
  1. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient# pecl install sphinx
  2. downloading sphinx-1.3.2.tgz ...
  3. Starting to download sphinx-1.3.2.tgz (15,282 bytes)
  4. .....done: 15,282 bytes
  5. 4 source files, building
  6. running: phpize
  7. Configuring for:
  8. PHP Api Version:         20121113
  9. Zend Module Api No:      20121212
  10. Zend Extension Api No:   220121212
  11. Please provide the installation prefix of libsphinxclient [autodetect] : /usr/local/libsphinxclient    #libsphinxclient 前缀
  12. building in /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2
  13. running: /tmp/pear/temp/sphinx/configure --with-sphinx=/usr/local/libsphinxclient
  14. checking for grep that handles long lines and -e... /bin/grep
  15. checking for egrep... /bin/grep -E
  16. checking for a sed that does not truncate output... /bin/sed
  17. checking for cc... cc
  18. checking whether the C compiler works... yes
  19. checking for C compiler default output file name... a.out
  20. checking for suffix of executables...
  21. checking whether we are cross compiling... no
  22. checking for suffix of object files... o
  23. checking whether we are using the GNU C compiler... yes
  24. checking whether cc accepts -g... yes
  25. checking for cc option to accept ISO C89... none needed
  26. checking how to run the C preprocessor... cc -E
  27. checking for icc... no
  28. checking for suncc... no
  29. checking whether cc understands -c and -o together... yes
  30. checking for system library directory... lib
  31. checking if compiler supports -R... no
  32. checking if compiler supports -Wl,-rpath,... yes
  33. checking build system type... x86_64-unknown-linux-gnu
  34. checking host system type... x86_64-unknown-linux-gnu
  35. checking target system type... x86_64-unknown-linux-gnu
  36. checking for PHP prefix... /usr
  37. 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
  38. checking for PHP extension directory... /usr/lib/php5/20121212
  39. checking for PHP installed headers prefix... /usr/include/php5
  40. checking if debug is enabled... no
  41. checking if zts is enabled... no
  42. checking for re2c... no
  43. configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
  44. checking for gawk... no
  45. checking for nawk... nawk
  46. checking if nawk is broken... no
  47. checking for sphinx support... yes, shared
  48. checking for libsphinxclient headers in /usr/local/libsphinxclient... found
  49. checking for sphinx_create in -lsphinxclient... yes
  50. checking for sphinx_get_string in -lsphinxclient... yes
  51. checking for new sphinx_set_ranking_mode() signature... no
  52. checking for SPH_RANK_PROXIMITY in sphinxclient.h... found
  53. checking for SPH_RANK_MATCHANY in sphinxclient.h... found
  54. checking for SPH_RANK_FIELDMASK in sphinxclient.h... found
  55. checking for SPH_RANK_SPH04 in sphinxclient.h... found
  56. checking for SPH_RANK_EXPR in sphinxclient.h... not found
  57. checking for SPH_RANK_TOTAL in sphinxclient.h... not found
  58. checking how to print strings... printf
  59. checking for a sed that does not truncate output... (cached) /bin/sed
  60. checking for fgrep... /bin/grep -F
  61. checking for ld used by cc... /usr/bin/ld
  62. checking if the linker (/usr/bin/ld) is GNU ld... yes
  63. checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
  64. checking the name lister (/usr/bin/nm -B) interface... BSD nm
  65. checking whether ln -s works... yes
  66. checking the maximum length of command line arguments... 1572864
  67. checking whether the shell understands some XSI constructs... yes
  68. checking whether the shell understands "+="... yes
  69. checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
  70. checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
  71. checking for /usr/bin/ld option to reload object files... -r
  72. checking for objdump... objdump
  73. checking how to recognize dependent libraries... pass_all
  74. checking for dlltool... no
  75. checking how to associate runtime and link libraries... printf %s\n
  76. checking for ar... ar
  77. checking for archiver @FILE support... @
  78. checking for strip... strip
  79. checking for ranlib... ranlib
  80. checking for gawk... (cached) nawk
  81. checking command to parse /usr/bin/nm -B output from cc object... ok
  82. checking for sysroot... no
  83. checking for mt... mt
  84. checking if mt is a manifest tool... no
  85. checking for ANSI C header files... yes
  86. checking for sys/types.h... yes
  87. checking for sys/stat.h... yes
  88. checking for stdlib.h... yes
  89. checking for string.h... yes
  90. checking for memory.h... yes
  91. checking for strings.h... yes
  92. checking for inttypes.h... yes
  93. checking for stdint.h... yes
  94. checking for unistd.h... yes
  95. checking for dlfcn.h... yes
  96. checking for objdir... .libs
  97. checking if cc supports -fno-rtti -fno-exceptions... no
  98. checking for cc option to produce PIC... -fPIC -DPIC
  99. checking if cc PIC flag -fPIC -DPIC works... yes
  100. checking if cc static flag -static works... yes
  101. checking if cc supports -c -o file.o... yes
  102. checking if cc supports -c -o file.o... (cached) yes
  103. checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
  104. checking whether -lc should be explicitly linked in... no
  105. checking dynamic linker characteristics... GNU/Linux ld.so
  106. checking how to hardcode library paths into programs... immediate
  107. checking whether stripping libraries is possible... yes
  108. checking if libtool supports shared libraries... yes
  109. checking whether to build shared libraries... yes
  110. checking whether to build static libraries... no
  111. configure: creating ./config.status
  112. config.status: creating config.h
  113. config.status: executing libtool commands
  114. running: make
  115. /bin/bash /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/sphinx -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/include -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/main -I/tmp/pear/temp/sphinx -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/libsphinxclient/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/sphinx/sphinx.c -o sphinx.lo
  116. libtool: compile:  cc -I. -I/tmp/pear/temp/sphinx -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/include -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/main -I/tmp/pear/temp/sphinx -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/libsphinxclient/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/sphinx/sphinx.c  -fPIC -DPIC -o .libs/sphinx.o
  117. /bin/bash /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/include -I/tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/main -I/tmp/pear/temp/sphinx -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/libsphinxclient/include  -DHAVE_CONFIG_H  -g -O2   -o sphinx.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules  sphinx.lo -Wl,-rpath,/usr/local/libsphinxclient/lib -L/usr/local/libsphinxclient/lib -lsphinxclient -Wl,-rpath,/usr/local/libsphinxclient/lib -L/usr/local/libsphinxclient/lib -lsphinxclient
  118. libtool: link: cc -shared  -fPIC -DPIC  .libs/sphinx.o   -Wl,-rpath -Wl,/usr/local/libsphinxclient/lib -Wl,-rpath -Wl,/usr/local/libsphinxclient/lib -L/usr/local/libsphinxclient/lib /usr/local/libsphinxclient/lib/libsphinxclient.so  -O2 -Wl,-rpath -Wl,/usr/local/libsphinxclient/lib -Wl,-rpath -Wl,/usr/local/libsphinxclient/lib   -Wl,-soname -Wl,sphinx.so -o .libs/sphinx.so
  119. libtool: link: ( cd ".libs" && rm -f "sphinx.la" && ln -s "../sphinx.la" "sphinx.la" )
  120. /bin/bash /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/libtool --mode=install cp ./sphinx.la /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules
  121. libtool: install: cp ./.libs/sphinx.so /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules/sphinx.so
  122. libtool: install: cp ./.libs/sphinx.lai /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules/sphinx.la
  123. libtool: finish: PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin" ldconfig -n /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules
  124. ----------------------------------------------------------------------
  125. Libraries have been installed in:
  126.    /tmp/pear/temp/pear-build-rootaxCAVo/sphinx-1.3.2/modules

  127. If you ever happen to want to link against installed libraries
  128. in a given directory, LIBDIR, you must either use libtool, and
  129. specify the full pathname of the library, or use the `-LLIBDIR'
  130. flag during linking and do at least one of the following:
  131.    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  132.      during execution
  133.    - add LIBDIR to the `LD_RUN_PATH' environment variable
  134.      during linking
  135.    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  136.    - have your system administrator add LIBDIR to `/etc/ld.so.conf'

  137. See any operating system documentation about shared libraries for
  138. more information, such as the ld(1) and ld.so(8) manual pages.
  139. ----------------------------------------------------------------------

  140. Build complete.
  141. Don't forget to run 'make test'.

  142. running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2" install
  143. Installing shared extensions:     /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr/lib/php5/20121212/
  144. running: find "/tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2" | xargs ls -dils
  145. 4194391   4 drwxr-xr-x 3 root root   4096  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2
  146. 4194413   4 drwxr-xr-x 3 root root   4096  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr
  147. 4194414   4 drwxr-xr-x 3 root root   4096  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr/lib
  148. 4194415   4 drwxr-xr-x 3 root root   4096  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr/lib/php5
  149. 4194416   4 drwxr-xr-x 2 root root   4096  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr/lib/php5/20121212
  150. 4194412 192 -rwxr-xr-x 1 root root 194448  1月  3 12:46 /tmp/pear/temp/pear-build-rootaxCAVo/install-sphinx-1.3.2/usr/lib/php5/20121212/sphinx.so

  151. Build process completed successfully
  152. Installing '/usr/lib/php5/20121212/sphinx.so'
  153. install ok: channel://pecl.php.net/sphinx-1.3.2
  154. configuration option "php_ini" is not set to php.ini location
  155. You should add "extension=sphinx.so" to php.ini
  156. root:/var/coreseek-4.1-beta/testpack/api/libsphinxclient#
复制代码
05、修改 /etc/php5/fpm/php.ini 配置文件
  1. vi /etc/php5/fpm/php.ini
复制代码

extension=sphinx.soextension=/usr/lib/php5/20121212/sphinx.so 添加到 /etc/php5/fpm/php.ini 文件相应位置。如下所示:

  1. ; For example, on Windows:
  2. ;
  3. ;   extension=msql.dll   
  4. ;
  5. ; ... or under UNIX:
  6. ;
  7. ;   extension=msql.so
  8.     extension=sphinx.so    #添加项
  9. ;
  10. ; ... or with a path:
  11. ;
  12. ;   extension=/path/to/extension/msql.so
  13.     extension=/usr/lib/php5/20121212/sphinx.so    #添加项
  14. ;
  15. ; If you only provide the name of the extension, PHP will look for it in its
  16. ; default extension directory.
复制代码
06、重载、重启 php5-fpm  5.5.9nginx 1.4.6
  1. root:# service php5-fpm reload
  2. root:# service php5-fpm restart
  3. stop: Unknown instance:
  4. php5-fpm start/running, process 22075
  5. root:# service nginx reload
  6. * Reloading nginx configuration nginx                                                                             [ OK ]
  7. root:# service nginx restart
  8. * Restarting nginx nginx                                                                                          [ OK ]
  9. root:#
复制代码
07、创建名为 “info.php”PHP 探针文件,并测试
  1. vi /usr/share/nginx/html/info.php (或把 info.php 放到支持 php 的网站根目录下)
复制代码

文件内容:

  1. <?php
  2. phpinfo();
  3. ?>
复制代码

FireFoxIE 浏览器中键入 http://localhost/info.phphttp://127.0.0.1/info.php (或 http://服务器 IP 地址/info.phphttp://域名地址/info.php);若出现以下图片内容,说明 Sphinx 1.3.2 安装成功 (若仍没有出现,请重启一下 Ubuntu Server 14.04):


版权声明:
本文为独家原创稿件,版权归 德云社区,未经许可不得转载;否则,将追究其法律责任。
AI人工智能 语音助理 人工翻译 教程
回复

使用道具 举报

20

主题

42

帖子

153

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
91
金币
2
威望
0
贡献
0
 楼主| 发表于 2015-1-3 12:04:03 | 显示全部楼层
在线订购 便捷实惠 品质保证 终生保修
回复 支持 反对

使用道具 举报

20

主题

42

帖子

153

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
91
金币
2
威望
0
贡献
0
 楼主| 发表于 2015-1-3 12:04:18 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|Sitemap|小黑屋|德云社区 |网站地图  

GMT+8, 2024-11-23 08:11 , Processed in 0.037130 second(s), 28 queries .

工业和信息化部: 粤ICP备14079481号-2

技术支持 乐数软件     版权所有 © 2014-2021 德云社区    

快速回复 返回顶部 返回列表