Monday, July 30, 2012

mapserver php: php_mapscript.so unable to load dynamic library

was able to experience this in two different scenarios

1.) got:
Warning: dl() [function.dl]: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_mapscript.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_mapscript.so: cannot open shared object file: No such file or directory


Fatal error: Call to undefined function ms_newMapObj()

make sure mapserv is compiled with --with-php=/usr/local/include/php

create directory /usr/local/lib/php/extensions/no-debug-non-zts-20060613
copy mapserver-5.0.3/mapscript/php3/php_mapscript.so to the directory above

to test, create a php test file then browse
<HTML>
<BODY>
<?php
  if (PHP_OS == "WINNT" || PHP_OS == "WIN32")
  {
    dl("php_mapscript.dll");
  }
  else
  {
    dl("php_mapscript.so");
  }
  phpinfo();
?>
</BODY>
</HTML>


2.) got:
Warning: dl() [function.dl]: Unable to load dynamic library './php_mapscript.so' - ./php_mapscript.so: cannot open shared object file: No such file or directory


Fatal error: Call to undefined function ms_newMapObj()

check your php.ini and make sure you point the extension_dir parameter to where your mapscript is located.
i have mine in apache's modules directory
extension_dir = "/usr/local/apache2/modules/"

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...