[mapserver-users] Using PHPMapscript from php script called inconsole
Burgholzer,Robert
rwburgholzer at deq.virginia.gov
Wed May 14 07:10:25 PDT 2008
Just an update/repost of a problem that I have with php_mapscript from a
command line (DOS prompt in this case). I have not determined the
nature of the problem, which is quite vexing, but I did at least to make
a workaround. Since the same exact script runs fine via the http
process, I used wget to call my script. Anyhow, I thought I would
repost in case anyone has experienced this and/or found the cause.
Original Message with some updates:
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 tried loading the php_mapscript.dll from the
dl() command, just to be certain (although it was most definitely loaded
as indicated by the phpinfo() command).
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 );
When I call this script from the command line it yields:
Array( [0] => )
But when I call it from the browser, it gives a valid object:
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/20080514/5262bf3e/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT591917.txt
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080514/5262bf3e/attachment.txt>
More information about the MapServer-users
mailing list