LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2006, 09:19 AM   #1
Foomajick
LQ Newbie
 
Registered: Jan 2006
Location: Dublin
Distribution: Mandriva 2006 (desktop), Debian (server)
Posts: 16

Rep: Reputation: 0
Installing the native Berkeley XML database (in Debian)


There doesn't seem to be too much on the web about this, so I thought I'd share my experiences installing the Berkeley DBXML. It used to be owned by Sleepycat Software, but now belongs to Oracle.

The one webpage that keeps coming up for a Debian install is this one, and it seems a bit dated:

http://blog.parthenoncomputing.com/d...bian_buil.html

Well there doesn't seem to be another Debian install available, so this is how I installed from source.

First I got the source code from here:

http://www.oracle.com/technology/sof...xml/index.html

Berkeley DB XML 2.2.13 .tar.gz

After extracting (tar -xzf dbxml-2.2.13.tar.gz), instructions for install can be found here:

dbxml-2.2.13/dbxml/docs/ref_xml/xml_unix/intro.html

dbxml-2.2.13/dbxml/docs/ref_xml/xml_unix/install.html # gives a nice synopsis of the default options

dbxml-2.2.13/dbxml/docs/ref_xml/xml_unix/libs.html # describes how to build each dependency library manually

Intro.html says that the default install is to the /usr/local/BerkeleyDBXML.XX.XX directory. I had some trouble with this as I'll explain below.

Dbxml depends on four other libraries to work (please excuse my possibly incorrect use of terminology). There's the base Berkeley DB, then Pathan which helps with xpath, then Xerces which depends on Pathan, then XQuery which depends on Xerces and Pathan, then finally the dbxml itself, which depends on all of the above. Each library must be built (in that order) and point to the previously built libararies. You can do this individually from their own subdirectories (see libs.html, above) or by using the buildall.sh command (see intro.html above), which does exactly what it says on the tin.

Problems

When I first attempted to build using buildall.sh the install got as far as configuring the first library (Berkeley DB) and broke, giving the following error:

Quote:
multiple definition of `__i686.get_pc_thunk.bx
I found this post related to the error: http://dunedin.lug.net.nz/forums/showthread.php?t=62219

which suggested upgrading gcc and binutils. I replaced binutils 2.15-6 with binutils_2.17-3_i386.deb using aptitude, because I couldn't figure out how to get around it with apt-get. This may also involve allowing etch into your /etc/apt/sources.list and maybe apt-pinning, which I had in place already (see http://wiki.serios.net/wiki/Apt-Pinning_on_Debian)

Then I installed a new gcc (I was on gcc 3.3.5), went up to gcc-3.4. This I did with

Code:
apt-get install gcc-3.4
When installing DBXML, it is possible to give an option which points to a non-default gcc, but I found it easier to just change the symlink in my PATH to point to the new one (after installing gc-3.4 I now have 2 c compliers).

Code:
ls -l `which gcc` #will tell you which gcc is your default
cd /usr/bin
rm /usr/bin/gcc
ln -s gcc-3.4 gcc
And now your default C complier is gcc-3.4.

After several attempts to do the individual library build instead (and not being aware of 'make clean' and 'make distclean'), I removed the thing completely and unpacked again from the tar. Heavyhanded perhaps, but gives a clean slate. I found out during this trial and error that it was installing into the source directory, i.e. the directory where I had unpacked the tar. To fix this, I added a --prefix=$path to my buildall.sh just to be on the safe side. Also I want to enable Perl to interact with it, so I added that too. So to keep a long story short, here's the synopsis:

Code:
cd to where you downloaded the source
tar -xzvf dbxml-2.2.13.tar.gz
cd dbxml-2.2.13
./buildall.sh --prefix=/usr/local/BerkeleyDB --enable-perl
The buildall.sh script takes a LONG time. My server is a project to get a crappy old laptop to do cutting edge stuff, so it's having a Pentium 2, it took a full 3 hours to install.

Also. How to get PHP working with DBXML:

dbxml-2.2.13/dbxml/src/php/README
http://www.oracle.com/technology/pro...xml_faq.html#9
http://phpdbxml.4641.org/doku.php

More Debian/BDBXML info:
http://www.embeddedlinuxinterfacing....gBDBXMLThenPHP

Good luck. I hope this helps someone out. I'm expecting the next post to this thread to be a "why did you do all that when you could have just...", so post away! You will have increased web coverage of this topic by 100%.

Last edited by Foomajick; 10-30-2006 at 12:40 PM.
 
Old 12-16-2006, 05:35 PM   #2
Foomajick
LQ Newbie
 
Registered: Jan 2006
Location: Dublin
Distribution: Mandriva 2006 (desktop), Debian (server)
Posts: 16

Original Poster
Rep: Reputation: 0
Compiling PHP module for Berkeley DBXML

No big surprises here, I just followed the instructions to the 't' found on the Oracle DBXML FAQ at:

http://www.oracle.com/technology/pro...ml_faq.html#23

only I replaced the

Code:
/configure --with-db4=DB_HOME/install
with
/configure --with-db4=/usr/local/BerkeleyDB/
in step 2, and again in step 3 to

Code:
/configure --with-dbxml=/usr/local/BerkeleyDB/
because that's where I installed BDBXML.

During 'make' in step 3, I got the following error:

Quote:
In file included from /home/foomajick/programs/dbxml-2.2.13/dbxml/src/php/php_dbxml.cpp:11:
/home/foomajick/programs/dbxml-2.2.13/dbxml/src/php/php_dbxml_int.hpp:19:29: ext/db4/php_db4.h: No such file or directory
make: *** [php_dbxml.lo] Error 1
I found out that the file ext/db4/php_db4.h was being placed in /usr/include/php/ when all the other files included in php_dbxml_int.hpp were located in /usr/include/php5/ . So I did the obvious:

Code:
copy -R /usr/include/php/ext/ /usr/include/php5/ext/
Booyacasha.

Also: I had to update the php.ini file as per the last step on the Oracle FAQ, as well as adjusting the extension_dir directive to point to the location of db4.so and dbxml.so (which I believe is installed by default at /usr/lib/php5/20060613+lfs/). Do

Code:
apache2ctl restart
to reload the configurations.

Last thing: if you're using the php from the CLI, make sure to make the same updates as above to /etc/php5/cli/php.ini .

To test it go to DBXMLHome/dbxml/src/php/examples and run

Code:
php 01.php
or if you're really reckless like me you can just copy that php file to your /var/www/ and try it from the web. Don't leave it there though, and it SHOULD throw a permissions error!

And it works. (Well, I've been getting errors on the CLI 'Segmentation fault', but it works on the web!)
 
  


Reply

Tags
database, engine, native, xml



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The case for a native object database LXer Syndicated Linux News 0 08-11-2006 12:54 AM
XML database with python? (I don't understand the circular logic) flamesrock Programming 10 12-23-2004 08:31 PM
experiences with embedded mysql? XML instead of a database? SerfurJ Programming 2 12-11-2004 08:06 AM
xquerry on oracle 10g xml database anirudh Programming 1 09-27-2004 07:50 AM
MySQL: Importing a database from an XML file concoran General 0 09-08-2003 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration