[mapserver-users] GDal Mini drivers and php script under IIS 7 on Windows Server 2008

Luke coolhandluka at gmail.com
Mon May 11 17:31:03 PDT 2015


The IIS logs show 403 error which is a forbidden resource

I would check that you have IIS set to serve CGI.

I would still be suspect of permissions as well. Create a new IIS
application / app pool for your script and set the app pool to authenticate
as a AD user and explicitly grant permissions on data and application
locations. You can roll this back later if it solves the problem.

On Tue, May 12, 2015 at 8:46 AM, EVANS, JAMES R GS-13 USAF ACC 84
RADES/SCZE <james.evans.4 at us.af.mil> wrote:

> I think I have isolated the problem to GDAL.  When I just try running a
> gdal_translate, it fails to create the output file.  Here is what happens
> from the command prompt:
>
> C:\MapData>gdal_translate -of JPEG -outsize 512 512 land-sea.xml test.jpg
> Input file size is 20480, 10240
> 0ERROR 1: GDALWMS: Unable to download block 0, 0.
>   URL: http://localhost/mapserver/content/tile.php?T=Land-Sea&L=0&X=0&Y=4
>   HTTP status code: 200, error: (null).
> ERROR 1: land-sea.xml, band 1: IReadBlock failed at X offset 0, Y offset 0
>
> I'm not sure how to solve this.  I would think it is a permissions
> problem, but maybe a missing environment variable or something?  At least I
> do have a working system at home to help troubleshoot this.  Any help would
> be appreciated.
> Thanks,
> James
>
>
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:
> mapserver-users-bounces at lists.osgeo.org] On Behalf Of EVANS, JAMES R
> GS-13 USAF ACC 84 RADES/SCZE
> Sent: Monday, May 11, 2015 12:02 PM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] GDal Mini drivers and php script under IIS
> 7 on Windows Server 2008
>
> Still no resolution to this issue.  I gave the DefaultAppPool user Full
> Control over the MapData directory.  No help.  I then set Full Control of
> MapData to "Everyone".   Still no help.  I did figure out that Windows
> Server 2008 R2 doesn't come with the MS C++ Redistributables by default.  I
> installed those and now I can run the PHP script from the command line.  I
> still can't make URL request to the mapserver  requesting anything from the
> GDAL WW Minidriver though.  Below are the IIS log and Mapserver log entry.
> Any additional suggestions on how to troubleshoot this would be greatly
> appreciated.
>
>  Here are the logs from IIS:
>
> 2015-05-11 16:36:44 10.89.89.44 GET /mapserver/mapserv.exe
> map=content/servemap.map&service=WMS&request=GetMap&version=1.3&crs=CRS:84&layers=WAC_2014&styles=default&transparent=TRUE&format=image/png&width=512&height=512&bbox=72.0,22.5,74.25,24.75
> 80 - 10.89.89.74 Java/1.7.0_51 200 0 0 62
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=223&Y=101 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=224&Y=101 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=225&Y=101 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=226&Y=101 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=223&Y=100 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=224&Y=100 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=225&Y=100 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=226&Y=100 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=223&Y=99 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=224&Y=99 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=225&Y=99 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
> 2015-05-11 16:36:44 127.0.0.1 GET /mapserver/content/tile.php
> T=WAC_2014&L=5&X=226&Y=99 80 - 127.0.0.1 GDAL+WMS+driver+(
> http://www.gdal.org/frmt_wms.html) 403 1 5 0
>
> Here's what happens in the Mapserver Log:
>
> [Mon May 11 10:36:44 2015].62000 msDrawRasterLayerLow(WAC_2014): entering.
> [Mon May 11 10:36:44 2015].62000 msDrawRasterLayerLow(WAC_2014): Filename
> is: c:\MapData\WAC_2014.xml [Mon May 11 10:36:44 2015].62000
> msDrawRasterLayerLow(WAC_2014): Path is: c:\MapData\WAC_2014.xml [Mon May
> 11 10:36:44 2015].62000 msResampleGDALToMap in effect: cellsize = 0.002197
> [Mon May 11 10:36:44 2015].62000 msDrawGDAL(WAC_2014): using
> RAW_WINDOW=114687 29695 1026 1026, dst=0,0,1026,1026 [Mon May 11 10:36:44
> 2015].62000 msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,0
> [Mon May 11 10:36:44 2015].78000 drawGDAL(): Unable to access file.
> GDALDatasetRasterIO() failed: GetBlockRef failed at X block offset 223, Y
> block offset 57 [Mon May 11 10:36:44 2015].78000 msDrawMap(): Image
> handling error. Failed to draw layer named 'WAC_2014'.
> [Mon May 11 10:36:44 2015].78000 freeLayer(): freeing layer at
> 000000000043D5C0.
>
>
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:
> mapserver-users-bounces at lists.osgeo.org] On Behalf Of geographika
> Sent: Thursday, May 07, 2015 2:02 PM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] GDal Mini drivers and php script under IIS
> 7 on Windows Server 2008
>
> Hi,
>
> Definitely looks like a permissions issue.
> Try granting read-access on the c:\MapData folder to "IIS
> AppPool\DefaultAppPool" user - assuming this is the application pool that
> MapServer and/or PHP is running under using CGI.
> If that fails try granting "Everyone" read-only access to see if it is
> permissions.
>
> Regards,
>
> Seth
>
> On 07/05/2015 20:41, EVANS, JAMES R GS-13 USAF ACC 84 RADES/SCZE wrote:
> > I am making no progress on getting this working.  I did add the
> error_reporting(E_All) to the script, but I don't get any errors.  From the
> IIS log, it looks like the server is getting the request, php must be
> reading the script and calling the mini driver.  It looks like the gdal
> mini driver is trying to read the base imagery and is failing.  Here is a
> piece of the IIS log:
> >
> >
> > 2015-05-07 17:06:33 10.89.89.44 GET /mapserver/mapserv.exe
> > map=content/servemap.map&service=WMS&request=GetMap&version=1.3&crs=CR
> > S:84&layers=Land_Sea&styles=default&transparent=TRUE&format=image/png&
> > width=512&height=512&bbox=-72.0,18.0,-36.0,54.0 80 - 10.89.89.191
> > Java/1.7.0_51 200 0 0 1875
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=7&Y=6 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 2147500037 0
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=6&Y=6 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 3221225595
> > 718
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=8&Y=6 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 2147500037 0
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=6&Y=5 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 2147500037 0
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=7&Y=5 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 2147500037 0
> > 2015-05-07 17:06:33 127.0.0.1 GET /mapserver/content/tile.php
> > T=Land-Sea&L=1&X=8&Y=5 80 - 127.0.0.1
> > GDAL+WMS+driver+(http://www.gdal.org/frmt_wms.html) 500 0 2147500037
> > 15
> >
> > If I try to send the URL from a browser, I get back an error that says
> this:
> >
> > <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?> <!DOCTYPE
> > ServiceExceptionReport SYSTEM
> > "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
> > <ServiceExceptionReport version="1.1.1"> <ServiceException>
> > msDrawMap(): Image handling error. Failed to draw layer named
> 'Land_Sea'.
> > drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed:
> > c:\MapData\Land-Sea.xml, band 1: IReadBlock failed at X offset 9, Y
> > offset 4 </ServiceException> </ServiceExceptionReport>
> >
> > I really don't know how to troubleshoot this.  The pieces I have to work
> with are the map file, the layer XML files, for example Land-Sea.xml, the
> Tile.php script, (which seems to be working), and the tiled image set.
> These same pieces work great with the same version of Mapserver, from
> GISInternals, on Windows 7 running IIS 7.  I'm thinking that this must be a
> permissions problem on Windows Server 2008.  Any ideas on where to go from
> here would be appreciated.
> > Thanks,
> > James
> >
> >
> > -----Original Message-----
> > From: mapserver-users-bounces at lists.osgeo.org
> > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff
> > McKenna
> > Sent: Thursday, May 07, 2015 5:48 AM
> > To: mapserver-users at lists.osgeo.org
> > Subject: Re: [mapserver-users] GDal Mini drivers and php script under
> > IIS 7 on Windows Server 2008
> >
> >
> > I would definitely head to the command prompt on the Windows machine,
> and then call php.exe through the commandline, passing it your .php file
> that is supposed to generate your map image, such as:
> >
> >     php myscript.php
> >
> > You might also make sure that your test php script shows all errors (I
> think it can be set directly inside your script with:
> > error_reporting(E_ALL)  but I might be wrong on syntax...
> >
> > -jeff
> >
> > --
> > Jeff McKenna
> > MapServer Consulting and Training Services
> > http://www.gatewaygeomatics.com/
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 

*Luke Bassett*
* <lukembassett at gmail.com>*Melbourne Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150512/52688793/attachment-0001.html>


More information about the mapserver-users mailing list