[mapserver-users] Using PHPMapscript from php script called in console

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Thu May 8 14:04:26 EDT 2008


I am having a strange occurrence.  I have a php script that uses PHP
mapscript to manipulate some maps.  I have no problem with it if I call
the script from my web browser, however, when I call it via command line
PHP, i.e., "php scriptname.php", it fails when I try to do anything with
the map object.

 

I have done a phpinfo() from my script and verified that mapscript is in
fact loaded when php is invoked from the command line.  It looks as
thought the command that I am using to instantiate the map object
instance is failing.

To create the object, I use: 

$this->map = ms_newMapObj($map_path.$map_file);

 

To verify this creation I use:

print_r((array)$this->map );

 

Which yields, Array( [0] => ) when I call it from the command line, and
a fill set of object properties from the browser, as in:

Array ( [_handle_] => Resource id #41 [numlayers] => 8 [name] =>
PrecipMap [status] => 1 [debug] => 1 [width] => 720 [height] => 500
[maxsize] => 2048 [transparent] => -1111 [interlace] => -1111
[imagetype] => AGG [imagequality] => -1111 [extent] => ms_rect_obj
Object ( [_handle_] => Resource id #42 [minx] => -79.322914123535

... (etc. etc.)

 

The only difference that I can think of is that the php-cgi.exe is
getting used by the browser, while php.exe is used at the command line.
I tried executing the script with the cgi version, but to no avail, same
behaviour, script dies without any word whenever I try to call a mapObj
method.

 

System:

Windows XP

PHP 5.2.5 

Mapscript - PHP MapScript Version => ($Revision: 7251 $ $Date:
2008-01-08 12:04:53 -0500 (Tue, 08 Jan 2008) $)

 

Any guidance would be appreciated,

r.b.

 

Robert W. Burgholzer

Surface Water Modeler

Office of Water Supply and Planning

Virginia Department of Environmental Quality

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080508/74a801d0/attachment.html


More information about the mapserver-users mailing list