<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Almost there. There are additional migration examples in:
    <a class="moz-txt-link-freetext" href="https://ms4w.com/trac/wiki/MigrationGuide5.x">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="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Undefined
      array key "metadata""</span><br>
    <br>
    <span
style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span>Any
        idea?<br>
      </span></span><br>
    <div class="moz-cite-prefix">On 29/10/2023 07:52, Vassilis
      Chatzigiannakis wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB4PR09MB5871BCC38E48C8F7D1D44136A6A2A@DB4PR09MB5871.eurprd09.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:0cm;
        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:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:18.0pt;
        font-family:"Calibri",sans-serif;}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.EmailStyle21
        {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">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">);<o:p></o:p></span></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 0cm 0cm 0cm">
            <p class="MsoNormal"><b>From:</b> Jan Hartmann
              <a class="moz-txt-link-rfc2396E" href="mailto:j.l.h.hartmann@gmail.com"><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 class="moz-txt-link-rfc2396E" href="mailto:vchatzi@itml.gr"><vchatzi@itml.gr></a>; <a class="moz-txt-link-abbreviated" 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>
        <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 0cm 0cm 0cm">
              <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>
            <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:0cm;margin-bottom:12.0pt;margin-left:0cm">
                    <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:0cm;margin-bottom:12.0pt;margin-left:0cm">
                    <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:0cm;margin-bottom:12.0pt;margin-left:0cm">
                        <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:0cm;margin-bottom:12.0pt;margin-left:0cm">
                        <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>
      </div>
    </blockquote>
    <br>
  </body>
</html>