使用pecl安装SVN扩展时出错

the*_*edp 5 php svn pecl

我正在尝试安装以下PHP扩展:http://php.net/manual/en/book.svn.php 但是当我这样做时,pecl install svn-beta我收到一条错误消息,它无法找到该svn_client.h文件.我在网上搜索但找不到任何对这个错误的有用参考.

谢谢您的帮助.

安装结果:

root@myUbuntu:/home/thedp# pecl install svn-beta
downloading svn-0.5.1.tgz ...
Starting to download svn-0.5.1.tgz (23,563 bytes)
.....done: 23,563 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
 1. Please provide the prefix of Subversion installation : autodetect

1-1, 'all', 'abort', or Enter to continue: 
 1. Please provide the prefix of the APR installation used with Subversion : autodetect

1-1, 'all', 'abort', or Enter to continue: 
building in /var/tmp/pear-build-root/svn-0.5.1
running: /tmp/pear/temp/svn/configure --with-svn --with-svn-apr
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 gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -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... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20060613+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 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 svn support... yes, shared
checking for specifying the location of apr for svn... yes, shared
checking for svn includes... configure: error: failed to find svn_client.h
ERROR: `/tmp/pear/temp/svn/configure --with-svn --with-svn-apr' failed
Run Code Online (Sandbox Code Playgroud)

tmo*_*ont 12

你真的安装了svn libs吗?看起来你在Ubuntu上,所以做一些类似的事情apt-get install libsvn-dev可能会安装所需的头文件和库.

PECL扩展是C客户端库的包装器,但它们(通常)不与这些客户端库的库和头文件捆绑在一起.

  • 对于fedora,我必须做"yum install subversion-devel"来获取与subversion相关的头文件,然后才能使用pecl安装svn client lib. (4认同)
  • 你需要配置php来加载`php.ini`中的扩展名.假设你没有做任何自定义的东西,你应该能够在该文件中的某处添加"extension = svn.so"行,它会自动找到它.然后你可以从命令行用`php -m`查看所有加载的模块.或者更多细节你可以做`php --re svn`来查看功能细节. (2认同)