<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
Thanks Steve. I should have been able to guess that, but the
PHP-MapScript documentation
(<a class="moz-txt-link-freetext" href="https://mapserver.org/mapscript/php/index.html">https://mapserver.org/mapscript/php/index.html</a>) still has a
metadata member for the MapObj. As well as for the WebObj<br>
<br>
As has been said before, the documentation for PHP Mapscript
(<a class="moz-txt-link-freetext" href="https://mapserver.org/mapscript/php/index.html">https://mapserver.org/mapscript/php/index.html</a>) is not very
helpful. Essentially, it still describes the pre-SWIG version. I
have been compiling MapServer since before the first marvelous
MapServer-meeting in 2003 (<a class="moz-txt-link-freetext"
href="https://maps.hisgis.nl/conferences/2003/mum/">https://maps.hisgis.nl/conferences/2003/mum/</a>,
look at the photographs!), but I have been using the UbuntuGIS
version for the last few years. It was really a pain to get the
current version working from scratch in a user directory. I was
almost starting to think about switching to GeoServer :-). To get
the "official" PHP-Mapscript-guide working I had to use:<br>
<br>
<a class="moz-txt-link-freetext"
href="https://ms4w.com/trac/wiki/MigrationGuide5.x">https://ms4w.com/trac/wiki/MigrationGuide5.x</a>
<br>
<a class="moz-txt-link-freetext" href="https://mapserver.org/MIGRATION_GUIDE.html">https://mapserver.org/MIGRATION_GUIDE.html</a> <br>
<a class="moz-txt-link-freetext" href="https://mapserver.org/mapscript/php/migration_guide.html">https://mapserver.org/mapscript/php/migration_guide.html</a><br>
<a class="moz-txt-link-freetext" href="https://mapserver.org/mapscript/php/index.html">https://mapserver.org/mapscript/php/index.html</a><br>
<br>
The main new requirements (including mapscript.php and setting
mapserver.conf) core-dump the PHP-script when missing, so that too
leads to some not-so-nice debugging. I would strongly advise to
bring the documentation of MapScript up to date and to base it on
the most recent version. And to clean out a bit the remnants of
previous releases.<br>
<br>
There seems to be a working Docker-version for MapServer/Mapscript
in Debian Bookworm
(<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/mapserver-dev/2023-October/017032.html">https://lists.osgeo.org/pipermail/mapserver-dev/2023-October/017032.html</a>),
but I haven't tested it yet. Has anyone worked with it? And does
anyone know of a recent Docker version for Mapserver/Mapscript in
Alpine? Some organisations I am working for in the Euregio
Aachen-Liege-Maastricht require Alpine for their Docker version.<br>
<br>
Anyway, thanks to Tanya, Vassilis and Steve,<br>
<br>
Jan Hartmann<br>
Amsterdam<br>
<br>
<div class="moz-cite-prefix">On 30/10/2023 18:56, Lime, Steve D
(MNIT) wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DM6PR09MB4806DEC4BD6A36A325ED8F41DAA1A@DM6PR09MB4806.namprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:18.0pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Calibri Light",sans-serif;
color:#2F5496;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Map-level metadata lives in the WEB object…
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> MapServer-users <a
class="moz-txt-link-rfc2396E"
href="mailto:mapserver-users-bounces@lists.osgeo.org"><mapserver-users-bounces@lists.osgeo.org></a>
<b>On Behalf Of </b>Jan Hartmann via MapServer-users<br>
<b>Sent:</b> Monday, October 30, 2023 12:46 PM<br>
<b>To:</b> Vassilis Chatzigiannakis <a
class="moz-txt-link-rfc2396E"
href="mailto:vchatzi@itml.gr"><vchatzi@itml.gr></a>;
<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [MapServer-users] Docker image for
MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Almost there. There are additional
migration examples in: <a
href="https://ms4w.com/trac/wiki/MigrationGuide5.x"
moz-do-not-send="true" class="moz-txt-link-freetext">
https://ms4w.com/trac/wiki/MigrationGuide5.x</a><br>
<br>
<br>
I wrote wrapper functions for the old ms_new... functions,
and can create that way a new mapObj called $oMap. <br>
<br>
The "set" function has been renamed to "__set" : not
$oMap->set("maxsize",6020), but:
;$oMap->__set("maxsize",6020);<br>
<br>
Layers can be declared as before: $layer =
$oMap->getLayer(1). <br>
<br>
Metadata have to be set as follows:<br>
<br>
Not: $layer->setMetadata("...","..."); but:
$layer->metadata->set("...","...")<br>
<br>
However, I cannot set the metadata of the mapObj:
$oMap->metadata->set("...","...") gives: "<span
style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Undefined
array key "metadata""</span><br>
<br>
<span
style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Any
idea?<br>
<br>
</span><o:p></o:p></p>
<div>
<p class="MsoNormal">On 29/10/2023 07:52, Vassilis
Chatzigiannakis wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Yes the documentation is a mess .<o:p></o:p></p>
<p class="MsoNormal">I worked with this reference:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><a
href="https://mapserver.org/mapscript/mapscript-api/index.html"
moz-do-not-send="true" class="moz-txt-link-freetext">https://mapserver.org/mapscript/mapscript-api/index.html</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">So, you start by <o:p></o:p></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1E1E1E"><span
style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE">$oMap</span><span
style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4"> = </span><span
style="font-size:10.5pt;font-family:Consolas;color:#569CD6">new</span><span
style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:#4EC9B0">mapObj</span><span
style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4">(</span><span
style="font-size:10.5pt;font-family:Consolas;color:#9CDCFE">$mapfile</span><span
style="font-size:10.5pt;font-family:Consolas;color:#D4D4D4">);</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Vassilis<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Jan Hartmann <a
href="mailto:j.l.h.hartmann@gmail.com"
moz-do-not-send="true">
<j.l.h.hartmann@gmail.com></a> <br>
<b>Sent:</b> Saturday, October 28, 2023 9:14 PM<br>
<b>To:</b> Vassilis Chatzigiannakis <a
href="mailto:vchatzi@itml.gr" moz-do-not-send="true"><vchatzi@itml.gr></a>;
<a href="mailto:mapserver-users@lists.osgeo.org"
moz-do-not-send="true" class="moz-txt-link-freetext">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [MapServer-users] Docker image for
MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">This seems
to work. And it says so in the migration guide (<a
href="https://mapserver.org/mapscript/php/migration_guide.html"
moz-do-not-send="true" class="moz-txt-link-freetext">https://mapserver.org/mapscript/php/migration_guide.html</a>):<br>
<br>
<span
style="font-size:9.5pt;font-family:"Arial",sans-serif;color:#3E4349;background:white">all
of your PHP scripts (that leverage MapServer objects and
functions) must now always first include the generated <cite><span
style="font-family:"Arial",sans-serif">mapscript.php</span></cite> file
containing MapServer constants:</span><br>
<br>
But could it be that only "$m = new mapObj('...');" is
accepted, and "$m=ms_newMapObj('...');" isn't? The docs
still mention the old call (<a
href="https://mapserver.org/mapscript/php/phpmapscript.html"
moz-do-not-send="true" class="moz-txt-link-freetext">https://mapserver.org/mapscript/php/phpmapscript.html</a><o:p></o:p></p>
<div>
<p class="MsoNormal">On 28/10/2023 09:11, Vassilis
Chatzigiannakis wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal">I did it recently. There should be a
mapscript.php file in the same folder as the
php_mapscriptng.so extension.<o:p></o:p></p>
<p class="MsoNormal">You need to include it in your php
script.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best,<o:p></o:p></p>
<p class="MsoNormal">Vassilis<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> MapServer-users <a
href="mailto:mapserver-users-bounces@lists.osgeo.org"
moz-do-not-send="true">
<mapserver-users-bounces@lists.osgeo.org></a>
<b>On Behalf Of </b>Jan Hartmann via
MapServer-users<br>
<b>Sent:</b> Friday, October 27, 2023 9:42 PM<br>
<b>To:</b> <a
href="mailto:mapserver-users@lists.osgeo.org"
moz-do-not-send="true"
class="moz-txt-link-freetext">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [MapServer-users] Docker image
for MapServer with PHP-MapScript<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I made a docker version of
mapserver/php-mapscript myself, based on Ubuntu 22.04. I
installed all required libraries with apt, and compiled
mapserver and mapscript according to instructions. No
problem at all.<br>
<br>
At the end I got the following from phpinfo();<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<h2 style="text-align:center;background:white"
align="center"><a name="module_mapscript"
moz-do-not-send="true"><span
style="font-size:15.0pt;font-family:"Arial",sans-serif;color:#222222">mapscript</span></a><span
style="mso-bookmark:module_mapscript"></span><o:p></o:p></h2>
<table class="MsoNormalTable"
style="width:700.5pt;background:white;border-collapse:collapse;box-shadow: rgb(204, 204, 204) 1px 2px 3px;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px"
width="934" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td
style="width:225.0pt;border:solid #666666 1.0pt;background:#CCCCFF;padding:3.0pt 3.75pt 3.0pt 3.75pt"
width="300" valign="bottom">
<p class="MsoNormal"
style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<b><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer
Version</span></b><o:p></o:p></p>
</td>
<td
style="border:solid #666666 1.0pt;border-left:none;background:#DDDDDD;padding:3.0pt 3.75pt 3.0pt 3.75pt;overflow-x: auto;overflow-wrap: break-word"
valign="bottom">
<p class="MsoNormal"
style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer
version 8.0.1 PROJ version 9.3 GDAL version
3.4 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
INPUT=FLATGEOBUF</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
But no mapscript function or object was regognized in my
PHP-scripts:<br>
<br>
PHP Fatal error: Uncaught Error: Class "mapObj" not
found in /virdir/www_root/test.php:2<br>
Stack trace:<br>
#0 {main}<br>
thrown in /virdir/www_root/test.php on line 2<br>
<br>
<br>
I am really desparate. Has anyone ever succeeded to get
php_mapscriptng.so to work? Or does anyone know of a
working Docker image for MapServer with PHP MapScript?<br>
<br>
Jan<o:p></o:p></p>
<div>
<p class="MsoNormal">On 21/10/2023 05:40, Jan Hartmann
wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">I
tried this with serveral versions of PHP and
MapServer, but got always the same result. Can anyone
point me to a Docker image for MapServer +
PHP-MapScript?<br>
<br>
Jan<o:p></o:p></p>
<div>
<p class="MsoNormal">On 19/10/2023 18:12, Jan Hartmann
wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Still
not there. Everything has been installed, and
phpinfo() gives:<o:p></o:p></p>
<table class="MsoNormalTable"
style="width:700.5pt;background:white;border-collapse:collapse;box-shadow: rgba(0, 0, 0, 0.2) 1px 2px 3px;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;word-spacing:0px"
width="934" cellspacing="0" cellpadding="0"
border="0">
<tbody>
<tr>
<td
style="width:225.0pt;border:solid #666666 1.0pt;background:#CCCCFF;padding:3.0pt 3.75pt 3.0pt 3.75pt"
width="300" valign="bottom">
<p class="MsoNormal"
style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<b><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer
Version</span></b><o:p></o:p></p>
</td>
<td
style="border:solid #666666 1.0pt;border-left:none;background:#DDDDDD;padding:3.0pt 3.75pt 3.0pt 3.75pt;overflow-x: auto;overflow-wrap: break-word"
valign="bottom">
<p class="MsoNormal"
style="mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#222222">MapServer
version 8.0.1 PROJ version 9.3 GDAL
version 3.7 OUTPUT=PNG OUTPUT=JPEG
SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=OGCAPI_SERVER
INPUT=JPEG INPUT=POSTGIS INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE
INPUT=FLATGEOBUF</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><br>
But calling "$map = new mapObj('mapfile.map');"
gives: <br>
<br>
<b><span
style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">Fatal
error</span></b><span
style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">:
Uncaught Error: Class "mapObj" not found in
/mnt/virdir/www_root/test/test_mapscript.php:2
Stack trace: #0 {main} thrown in <b>/mnt/virdir/www_root/test/test_mapscript.php</b> on
line <b>2<br>
<br>
</b></span>Any idea?<br>
<br>
Jan<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</blockquote>
<br>
</body>
</html>