[Mapserver-dev] Can't run PHP/Mapscript as a CLI????

woodbri at swoodbridge.com woodbri at swoodbridge.com
Sun Jun 8 00:41:00 EDT 2003


HI all,

Not that most of you are about at the moment :) hope you are having 
fun at the MUM ...

I was trying to debug a php/mapscript application using php as a cli 
and got:

Fatal error: Due to thread-safety problems, php_mapscript cannot be 
used as a 'cli' module.  You will have to reconfigure your PHP as a 
CGI to run this version of MapScript. 
See <a href="http://mapserver.gis.umn.edu/cgi-
bin/wiki.pl?PHPMapScriptCGI">http://mapserver.gis.umn.edu/cgi-
bin/wiki.pl?PHPMapScriptCGI</a>.
 in /var/www/html/cwc/htdocs/common/wrapper/map_session.php on line 
214

Whoever is making this check needs to relax it so you can run as a 
CLI for debugging purposes. There may be other ways, but my standard 
way to debug server 500 errors and other problems is to run php like:

[root at woodbri htdocs]# export 
QUERY_STRING='TEMPLATE=geobase_en.html&CONTEXT=geobase_regional_en.xml
&sessionid=123455677'
[root at woodbri htdocs]# export REQUEST_METHOD=GET
[root at woodbri htdocs]# export REDIRECT_STATUS=200
[root at woodbri htdocs]# php cwc2.php 

or run it in the debugger to see where it dies. This used to work 
fine.

-Steve W.



More information about the mapserver-dev mailing list