[lug] libexpat.so.0 error unless Apache started by root user

Nate Duehr nate at natetech.com
Thu Feb 13 00:28:40 MST 2003


If expat libraries/packages are on a machine when apache's binaries are
built from source on it, the apache configure script will build apache to
use "external Expat" by default... you can see this announcement when it is
writing the Makefiles.  I have seen this on Apache 1.x, I have no experience
with building Apache 2.x yet.

You can override this with an option to the configure script, but I don't
have it here with me right now.

So if you build apache on a machine with expat installed and it uses the
external expat, it will look for the expat shared libraries if it's launched
on another machine without them and fail to run.

You usually see this when you move a copy of apache built in a different
environment from one machine to another.  If you are building it yourself, I
think the option is "--disable-external-expat" (or something similar to
that?) if you want apache to use its own expat implementation built in
statically.  Grep the configure script for it if you're building from
source.  Or it's probably mentioned somewhere in the docs.

If you want to fix it on that machine, make sure /usr/local/lib is included
in /etc/ld.so.conf so shared libraries in /usr/local/lib can be found
properly on a RedHat machine... that'd probably fix what you're seeing on
that box since the libraries for expat are actually present in the
directory.

This is all just from memory of having "seen this" before when I was messing
with building Apache 1.x stuff recently, but maybe someone who's a
programmer can explain why it defaults to using external expat and/or the
advantages/disadvantages of each.  It appears that expat is mostly used for
loading the conf files at runtime, if I understand what expat is
correctly...?  Definitely out on a limb with that statement!

Probably missing a whole bunch of info too... others can elaborate -- but
the change to /etc/ld.so.conf should get you going.

Nate Duehr, nate at natetech.com

----- Original Message -----
From: "Peter Janett" <mlists at newmediaone.com>
To: <users at httpd.apache.org>
Cc: <lug at lug.boulder.co.us>; <clue-tech at clue.denver.co.us>
Sent: Wednesday, February 12, 2003 11:59 PM
Subject: [lug] libexpat.so.0 error unless Apache started by root user


> I'm running Red Hat 7.2, php-4.2.3, expat-1.95.4.
>
> When I start Apache as root, it starts fine.
>
> But, my startups scripts fail, as does starting apache from a non root
user,
> with the following error:
>
> "bin/httpd: error while loading shared libraries: libexpat.so.0: cannot
open
> shared object file: No such file or directory"
>
> I can find a sys link (libexpat.so.0) and the file it links to in
> /usr/local/lib.  The permissions seem to be fine on the file, so maybe
it's
> a question of it being in the user paths.
>
> Any help appreciated.
>
> Peter Janett
>
> New Media One Web Services
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> New Upgrades Are Now Live!!!
> Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
> Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
> Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> PostgreSQL coming soon!
>
> http://www.newmediaone.net
> webmaster "at" newmediaone.net
> (303)828-9882
>
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>





More information about the LUG mailing list