views:

414

answers:

1

Hello,

I'm trying to install the following PHP extension: http://php.net/manual/en/book.svn.php But when I do pecl install svn-beta I receive an error message that it can't locate the svn_client.h file. I searched the net but couldn't find any useful reference to this error.

Thank you for your help.

Installation result:

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
+4  A: 

Do you actually have the svn libs installed? It appears you're on Ubuntu, so doing something like apt-get install libsvn-dev will probably install the needed headers and libs.

PECL extensions are wrappers around C client libraries, but they don't (usually) come bundled with the libs and headers for those client libraries.

tmont
I'm receiving error when I try to install `libsvn-dev`: `Reading The following packages have unmet dependencies: libsvn-dev: Depends: libsvn1 (= 1.5.4dfsg1-1ubuntu2) but 1.5.4dfsg1-1ubuntu2.1 is to be installed Depends: libapr1-dev but it is not going to be installed Depends: libaprutil1-dev but it is not going to be installed`
thedp
hmmm... that's unfortunate. which version of ubuntu are you running? it appears there is an issue on 9.04 with libsvn-dev: https://bugs.launchpad.net/ubuntu/+source/apr-util/+bug/371746. i just installed pecl extension svn-0.5.1 with all the default stuff on my 9.10 box, and everything worked.
tmont
to clarify that last sentence, the answer to your original question is in fact installing libsvn-dev. that will get you all the svn headers and libs, including `svn_client.h`
tmont
Geee, I can't believe my misfortune :)I indeed have Ubuntu 9.04... What are the odds.So, if I understand correctly, there is no solution to this problem, right?
thedp
i feel for you :). according to that link, it looks like there is a dependency version mismatch on the libdb package. your best is probably to upgrade, as that package is used quite a bit. you can use the `apt-rdepends` command to see what packages depend on it: `apt-rdepends -r --state-show=INSTALLED libdb4.6-dev`. the problem is that libapr depends on it, which is used all over the place, e.g. apache
tmont
I upgraded to Ubuntu 9.10, but not before I wasted more time with another Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/460015 :) I Installed the `libsvn-dev` and I think I managed to install `pecl install svn`, but I'm not sure. How can I list the installed extensions? (pecl documentation is quite poor.) Thanks you.
thedp
you'll need to configure php to load the extension in the `php.ini`. assuming you didn't do any kind of custom stuff, you should be able to just add the line `extension=svn.so` somewhere in that file and it'll find it automatically. then you can view all loaded modules with `php -m` from the command line. or for more detail you can do `php --re svn` to view the function details.
tmont
I searched my system for `svn.so`, but was unable to find the file. I have a feeling pecl didn't install it. Here is what I get when I do `pecl install svn-beta`: "Starting to download svn-0.5.1.tgz (23,565 bytes) .......done: 23,563 bytes" That's it. :\
thedp
what is the result of `pecl list`?
tmont
It's another Ubuntu 9.10 bug: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/445536 . I removed Ubuntu's pear package and I am now attempting to install pear manually - http://pear.php.net/manual/en/installation.php and of course it doesn't go smooth either... http://pastebin.com/m213e6201 It's official, I'm cursed :)
thedp
I think I just managed to install svn-beta with the Ubuntu 9.10 buggy pear... Using the work around pecl install -Z svn-beta, it downloaded and installed the extension. pecl list svn-beta proves it. I then added the line extension=svn.so to /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini, and then restarted Apache server. And it worked! php -m shows svn. Thank you so much for all your help.
thedp
yikes. what does -Z do? force it to use linux's zlib rather than the PEAR version or something? congrats on getting it working :)
tmont
It seems to be an undocumented option, but I'm guessing yes :)
thedp