gis - Getting an errno 2 when running a PHP script -


Hope to help me ... I've been on this for the last 2 days and I have to admit that I I'm stumped.

OS I am Ubuntu 9.10 is addictive.

I have successfully established and tested the manager. For my class project, I have a PHP script that I use to see a layer below ....

When I run the script at the CDD line prompt, I get the error:

  WARNING: [MAP server error]: msProcessProjection (): A system list, error: 2 /var/www/mapserverdocs/ms4w/apps/world/mapscripts/staticwms.php on line 16 Warning: Failure to open map file static.map in line 16 fatal error on /var/www/mapserverdocs/ms4w/apps/world/mapscripts/staticwms.php: / var Call a member function owsdispatch () on a non-object in / www / mapserverdocs / SMS4 / aps / wherl / mappripts / staticwms.php on line 18  

PHP script:

  & lt ;? Php if (! Extension_loaded ("MapScript")) DL ("php_mapscript"); $ Request = ms_newowsrequestobj (); Forex Currency ($ _GET = $ k => $ v) {$ request-> Set parameter ($ k, $ v); } $ Request- & gt; Setpalmator ("VRSION", "1.0.0"); Ms_ioinstallstdouttobuffer (); $ OMap = ms_newMapobj ("static.map"); $ OMap-> Owsdispatch ($ request); $ Contenttype = ms_iostripstdoutbuffercontenttype (); If ($ contenttype == 'image / png') {header ('content-type: image / png'); Ms_iogetStdoutBufferBytes (); } And {$ buffer = ms_iogetstdoutbufferstring (); Buffer $ buffer; } Ms_ioresethandlers (); ? & Gt;  

I used to make sure that it was not a permissible issue, only the world has created RWX and file

any help would be greatly appreciated !! As the meagar said, the issue is probably that this line:

thanks

P>

  $ oMap = ms_newMapobj ("static.map");  

Unable to find "static.map" The current working directory of PHP is not often how you expect it to make the path relative to the current script if static If the .map is the same code as static.map , then try this code:

  $ mapPath = dirname (__ file__). '/static.map'; $ OMap = ms_newMapobj ($ mapPath); $ OMap-> Owsdispatch ($ request);  

If static.map is turned on, then say, /var/www/mapserverdocs/ms4w/apps/world/mapfiles/static.map < / Code>, then try:

  $ mapPath = dirname (__ file __). '/ .. / static.map'; $ OMap = ms_newMapobj ($ mapPath); $ OMap-> Owsdispatch ($ request);  

Note * /../ * static.map dirname (__ file __) to insert that code into your PHP The file will return the name of the directory.


Comments