php mapscript problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

php mapscript problem

Sven Schroeter
Hi,

I write many mapfiles from an application to the file system under Windows
and IIS.
Another script loads this mapfiles and checks if it is the right syntax.
If there is an syntax error in the mapfile I'll get an exeption:

try {
        $oMap = ms_newMapobj($mymapfile);
} catch (Exception $e) {
        echo '<strong>Exception:</strong> ',  $e->getMessage(), "\n";
        exit;
}

But after I opened the mapfile with newMapobj I can't delete (with unlink)
or update the file because of a permission denied warnings.
How can I unset the loaded mapfile? Everything I tried did not work.
Or is there another way to check the syntax of a mapfile (with includes)?

Thanks Sven








_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: php mapscript problem

Carlos Ruiz
Sven,

I haven't worked with Mapscript and IIS. However, I always free the map before unsetting it on PHP

$oMap->free();
unset($oMap);

Why don't you try this and see what happens


On Friday, November 24, 2017, 9:04:16 AM CST, Sven Schroeter <[hidden email]> wrote:


Hi,

I write many mapfiles from an application to the file system under Windows
and IIS.
Another script loads this mapfiles and checks if it is the right syntax.
If there is an syntax error in the mapfile I'll get an exeption:

try {
    $oMap = ms_newMapobj($mymapfile);
} catch (Exception $e) {
    echo '<strong>Exception:</strong> ',  $e->getMessage(), "\n";
    exit;
}

But after I opened the mapfile with newMapobj I can't delete (with unlink)
or update the file because of a permission denied warnings.
How can I unset the loaded mapfile? Everything I tried did not work.
Or is there another way to check the syntax of a mapfile (with includes)?

Thanks Sven








_______________________________________________
mapserver-users mailing list

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: php mapscript problem

Sven Schroeter
Carlos,

thanks for your answer.
$oMap->free();
unset($oMap);
doesn't work. Mayby it's a bug?
I found this old issue with C# mapscript on Windows:
https://github.com/mapserver/mapserver/issues/1994

Sven



Von: Carlos Ruiz [mailto:[hidden email]]
Gesendet: Freitag, 24. November 2017 16:42
An: [hidden email]; Sven Schroeter
Betreff: Re: [mapserver-users] php mapscript problem

Sven,

I haven't worked with Mapscript and IIS. However, I always free the map before unsetting it on PHP

$oMap->free();
unset($oMap);

Why don't you try this and see what happens


On Friday, November 24, 2017, 9:04:16 AM CST, Sven Schroeter <[hidden email]> wrote:


Hi,

I write many mapfiles from an application to the file system under Windows
and IIS.
Another script loads this mapfiles and checks if it is the right syntax.
If there is an syntax error in the mapfile I'll get an exeption:

try {
    $oMap = ms_newMapobj($mymapfile);
} catch (Exception $e) {
    echo '<strong>Exception:</strong> ',  $e->getMessage(), "\n";
    exit;
}

But after I opened the mapfile with newMapobj I can't delete (with unlink)
or update the file because of a permission denied warnings.
How can I unset the loaded mapfile? Everything I tried did not work.
Or is there another way to check the syntax of a mapfile (with includes)?

Thanks Sven








_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users