<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    This seems to work.  And it says so in the migration guide
    (<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>
    <br>
    <span
style="color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 12.8px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">all
      of your PHP scripts (that leverage MapServer objects and
      functions) must now always first include the generated<span> </span></span><cite
style="color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 12.8px; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">mapscript.php</cite><span
style="color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 12.8px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span> </span>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 class="moz-txt-link-freetext" href="https://mapserver.org/mapscript/php/phpmapscript.html">https://mapserver.org/mapscript/php/phpmapscript.html</a><br>
    <br>
    <div class="moz-cite-prefix">On 28/10/2023 09:11, Vassilis
      Chatzigiannakis wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB4PR09MB5871D2138CC1BEF8326952E2A6A3A@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;}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;}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.EmailStyle19
        {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">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 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> Friday, October 27, 2023 9:42 PM<br>
              <b>To:</b> <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">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>
          <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="font-size:15.0pt;font-family:"Arial",sans-serif;color:#222222"><o:p></o:p></span></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<o:p></o:p></span></b></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<o:p></o:p></span></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<o:p></o:p></span></b></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<o:p></o:p></span></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>
      </div>
    </blockquote>
    <br>
  </body>
</html>