Opened 2 months ago
Last modified 7 days ago
#467 reopened defect
PHP: Unable to load dynamic library 'mapscript'
Reported by: | a.labenne | Owned by: | Jeff McKenna |
---|---|---|---|
Priority: | major | Milestone: | 5.2.0 release |
Component: | MS4W - Base | Version: | 5.0.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hello,
We tried the experimental 5.2.0 release and we found a bug when testing the quickmap.php script. We have the following error :
Fatal error: Uncaught Error: Class "mapObj" not found in C:\ms4w\Apache\htdocs\quickmap.php on line 19
If we enable the error_log in PHP.ini there is the following error that show up :
[08-Jul-2025 08:04:26 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mapscript' (tried: /ms4w/Apache/php/ext/mapscript (Le module spécifié est introuvable), /ms4w/Apache/php/ext/php_mapscript.dll (Le module spécifié est introuvable)) in Unknown on line 0 [08-Jul-2025 08:04:26 UTC] PHP Fatal error: Uncaught Error: Class "mapObj" not found in C:\ms4w\Apache\htdocs\quickmap.php:19 Stack trace: #0 {main} thrown in C:\ms4w\Apache\htdocs\quickmap.php on line 19
I verified and the php_mapscript.dll file exists in the searched location.
Do you have any clue for this kind of error ?
Regards,
Arnaud Labenne
Change History (5)
comment:1 by , 2 months ago
comment:2 by , 2 months ago
Also, be sure to run the /ms4w/tmp/VC_redist.x86.exe
installer before testing the experimental 5.2.0
comment:3 by , 8 weeks ago
Thanks for your reply.
I have run the VC_redist.x86.exe installer before testing. Try a fresh install but this does not fix my issue.
When running the command
php -dextension=C:/ms4w/Apache/php/ext/php_mapscript.dll -r "echo msGetVersion();"
I get the following error :
php : Le terme «php» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez. Au caractère Ligne:1 : 1 + php -dextension=C:/ms4w/Apache/php/ext/php_mapscript.dll -r "echo msG ... + ~~~ + CategoryInfo : ObjectNotFound: (php:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
If I run it with php-cgi.exe I get this error :
PHP Warning: PHP Startup: Unable to load dynamic library 'mapscript' (tried: /ms4w/Apache/php/ext/mapscript (Le module sp├®cifi├® est introuvable), /ms4w/Apache/php/ext/php_mapscript.dll (Le module sp├®cifi├® est introuvable)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'ogr' (tried: /ms4w/Apache/php/ext/ogr (Le module sp├®cifi├® est introuvable), /ms4w/Apache/php/ext/php_ogr.dll (Le module sp├®cifi├® est introuvable)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'C:/ms4w/Apache/php/ext/php_mapscript.dll' (tried: C:/ms4w/Apache/php/ext/php_mapscript.dll (Le module sp├®cifi├® est introuvable), /ms4w/Apache/php/ext/\php_C:/ms4w/Apache/php/ext/php_mapscript.dll.dll (Le module sp├®cifi├® est introuvable)) in Unknown on line 0 Error in argument 2, char 2: option not found r Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f <file>] php-cgi <file> [args...] -a Run interactively -b <address:port>|<port> Bind Path for external FASTCGI Server mode -C Do not chdir to the script's directory -c <path>|<file> Look for php.ini file in this directory -n No php.ini file will be used -d foo[=bar] Define INI entry foo with value 'bar' -e Generate extended information for debugger/profiler -f <file> Parse <file>. Implies `-q' -h This help -i PHP information -l Syntax check only (lint) -m Show compiled in modules -q Quiet-mode. Suppress HTTP Header output. -s Display colour syntax highlighted source. -v Version number -w Display source with stripped comments and whitespace. -z <file> Load Zend extension <file>. -T <count> Measure execution time of script repeated <count> times.
Side note : I encounter another error during the installation :
PS C:\ms4w> .\apache-install.bat Installing the 'Apache MS4W Web Server' service The 'Apache MS4W Web Server' service is successfully installed. Testing httpd.conf.... Errors reported here must be corrected before the service can be started. httpd: Syntax error on line 184 of C:/ms4w/Apache/conf/httpd.conf: Cannot load /ms4w/Apache/cgi-bin/mod_mapcache.dll into server: Le module sp\xe9cifi\xe9 est introuvable. Le service Apache MS4W Web Server démarre. Le service Apache MS4W Web Server n’a pas pu être lancé. Une erreur spécifique à un service s’est produite : 1. Vous obtiendrez une aide supplémentaire en entrant NET HELPMSG 3547.
Commenting the line in httpd.conf solved my issue
LoadModule mapcache_module "/ms4w/Apache/cgi-bin/mod_mapcache.dll"
comment:4 by , 8 days ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I started from scratch and the error is gone. I Might have omitted a configuration. I close the ticket
comment:5 by , 7 days ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
I just encouter the error. You can reproduce by starting a fresh install of MS4W 5.2.0 and following the install guide to enable direct Oracle Spatial access:
replace the existing libmap.dll in /ms4w/Apache/cgi-bin/ with the one in the /ms4w/msplugins/oracle/ folder
After replacing the libmap.dll file the quickmap.php file result in a 500 response.
When a restore the original libmap.dll file the error is gone and the map is displayed
Thanks for this report. I can't reproduce this with the experimental version yet, but what is the response when you try this command below?
It should return the MapServer version information such as: