[Mapserver-users] Shared library error with PHP MapScript

Doug ummmmm at myrealbox.com
Wed Jul 28 12:32:34 EDT 2004


Fedora Core 2, Apache 2, PHP 4.3.8, PHP-MapScript 4.2.1.

When we dl("php_mapscript.so") in a test php file, we get:

PHP Warning: dl(): Unable to load dynamic library 
'/usr/lib/php4/php_mapscript.so' - libpq.so.3: cannot open shared object 
file: No such file or directory in /var/www/html/test.php on line 2

in Apache's error log. But when we run the same file from the 
command-line (php test.php), there is no error and the MapScript section 
of phpinfo() is displayed fine.

Also, ldd/usr/lib/php4/php_ mapscript.so seems to show no problems with 
any of its .so files, including libpq.so.3.

Per an IRC channel suggestion, I also tried adding this to httpd.conf:

SetEnv LD_LIBRARY_PATH /usr/local/pgsql/lib/

But it made no difference.  I've also looked through the documentation 
and Wiki but can't find anything wrong.

One other potential factor is that both the mapscript and Postgres were 
compiled on a different system, then moved over from their "install" 
directories. I'm certainly willing to actually recompile on this new 
system if necessary, but that doesn't seem to be the current problem 
(since the standalone execution of the script works). It really seems to 
be an Apache-only issue right now.

Any ideas?

Doug



More information about the mapserver-users mailing list