[Mapserver-users] dynamic libraries and LDPATH

Daniel Morissette morissette at dmsolutions.ca
Fri Feb 21 14:59:49 EST 2003


"Madere, Colin" wrote:
> 
> So I get an error trying to use Mapscript because when the .so is loaded by
> PHP it can't find the libwwwxml.so.0 (turning error output on shows the
> typical ld.so error when it can't find a library).  


Sounds like libwwwxml.so is not in your runtime library path.  On Linux
the solution is to rerun /sbin/ldconfig after making sure that
/usr/local/lib is listed in your /etc/ld.so.conf, but since you're on
Solaris I'm not sure what's the best way to update the runtime libpath.


> So I found out that setting LDFLAGS = -R<location of libs> would instruct
> the linker to link in the library paths so that runtime resolution wasn't
> necessary. 

Try adding --enable-runpath to the MapServer configure, it should do
that for you.


> I've got mapserv CGI to run by wrapping it in a shell script that sets
> LD_LIBRARY_PATH for the .so it was looking for, however, with PHP and
> Mapscript it is a .so that loads a .so that loads a .so :)  LD_LIBRARY_PATH
> is not a solution there so I have to figure out how to get the linker to set
> the paths to the shared objects that the php_mapscript.so needs.
> 

Assuming that you're using Apache, you could use the SetEnv directive in
your httpd.conf to do that.

BTW, you seem to suggest that you are using PHP configured as an Apache
DSO... you need PHP configured as a CGI, see:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI

Yes I know, it's complicated, and Solaris isn't the most friendly
platform I would have to admit.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-users mailing list