Access map-file via php/mapscript
Daniel Morissette
morissette at dmsolutions.ca
Fri Jan 5 06:56:18 PST 2001
Michael Schulz wrote:
>
> We are using MapServer/PHP-Mapscript under Linux. A few days ago I
> downloaded the MapServer-Win-Binaries and the newest
> PHP4-MapScript-DLL's and installed them on a Win98-Labtop with Apache
> as webserver.
>
> Under win MapScript shows up as an extension in the php_info-page.
> Everything's fine so far... but I am not able to access any map-file!
>
> Under linux I did:
> $map = ms_newMapObj("/home/schulzm/mapserver/fr/fr.map");
> everything worked fine. Under win I changed it into
> $map = ms_newMapObj("c:\programme\mapserver\fr\fr.map");
> causing PHP to crash.
Michael,
I don't think that's the source of your crash, but in PHP, you should
escape the "\" character in your filename (just like in C or Perl):
$map = ms_newMapObj("c:\\programme\\mapserver\\fr\\fr.map");
But again I don't think this is the reason for the crash... MapScript
must have found the file and crashed while it was loading it.
> I tried to use relative pathnames and started
> the php-script from the directory where fr.map resides:
> $map = ms_newMapObj("fr.map");
> then i get a Mapscript error: 'MapServer Error in msLoadMap():
> (fr.map) in c:\programme\mapserver\fr\ms_fr.php on line 10'.
>
This error message suggests that MapScript could not locate fr.map...
but it should have found it since you placed it in the same dir as the
ms_fr.php script... so it must be something else then?!?
Which version of PHP4 have you installed on your computer? The
PHP4-MapScript DLL on our web site is compiled for PHP4.0.3pl1 ... so if
you installed another version of PHP4 (e.g. 4.0.4) and replaced your
php.exe with the one that was in the ZIP on our site, then that could
quite well explain the crash.
Please get back to me directly with info about your PHP4 config and
we'll see what we can do.
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list