[mapserver-users] PHP mapscript installation in Mapserver 7.4

Jeff McKenna jmckenna at gatewaygeomatics.com
Fri Jan 17 13:37:38 PST 2020


Hi Stefanos,

Your next step is to follow the Migration Guide, and change to the new 
syntax for declaring new SWIG MapScript objects (see 
https://mapserver.org/MIGRATION_GUIDE.html#mapserver-7-2-to-7-4-migration)

Please always reply-all, or, you can definitely contact me directly for 
professional support, at any time.

Have a nice weekend,


-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/



On 2020-01-17 4:59 p.m., Stefanos Anastasiou wrote:
> Hi Jeff,
> 
> Thank you for the reply.
> I did this way indeed and I thought it was  supposed to be installed. 
> The weird thing is that in phpinfo() I cannot see the Mapscript section 
> in it. For sure I saw there is a  libphp_mapscriptng.so in 
> /usr/lib/php/20190902 folder but phpinfo() shows that the extension_dir 
> is /usr/lib/php/20170718.  So I copied the .so file from 
>   /usr/lib/php/20190902 to /usr/lib/php/20170718 and restarted apache 
> but still nothing. I can't see the Mapscript section in the phpinfo() 
> page. I also try to load the test_draw_map.phtml page but I am getting 
> this error:
> 
> Fatal error: Uncaught Error: Call to undefined function ms_newMapObj() 
> in /var/www/html/test_draw_map.phtml:34
> 
> So I guess it's not loaded.
> 
> I'm not sure what I am missing.
> 
> Thanks a lot
> 
> -Stefanos
> 
> Στις Παρασκευή, 17 Ιανουαρίου 2020, 03:14:39 μ.μ. EET, ο χρήστης Jeff 
> McKenna <jmckenna at gatewaygeomatics.com> έγραψε:
> 
> 
> Hi Stefanos,
> 
> If you are trying to compile the new MapScript support through SWIG, for
> PHP7, then you should use "–DWITH_PHPNG=ON", as described at
> https://mapserver.org/installation/php.html#build-install-the-php-mapscript-module
> 
> Hope that helps.
> 
> Have a nice weekend,
> 
> -jeff
> 
> 
> 
> -- 
> Jeff McKenna
> MapServer Consulting and Training Services
> https://gatewaygeomatics.com/
> 
> 
> 
> On 2020-01-09 3:13 p.m., Stefanos Anastasiou wrote:
>  > Hello list,
>  >
>  >     I am confused about the new php mapcript version that comes with the
>  > SWIG family. I compiled a MapServer 7.4.3 version on my Ubuntu 19.04
>  > server (with php version 7.2.24) successfully with php and python 
> mapscript.
>  >
>  >   ....
>  >              -DWITH_PYTHON=ON \
>  >              -DWITH_PHP=ON \
>  >
>  > mapserv -v shows:
>  >
>  > MapServer version 7.4.3 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
>  > SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=XMP SUPPORTS=WMS_SERVER
>  > SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
>  > SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG
>  > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>  >
>  > However in my phpinfo() I could not see the MapScript section so I had
>  > to go to the php.ini and add the extension like
>  > extension=php_mapscript.so. After that and restarting the server I see
>  > it there now.
>  >
>  > Is this the right approach now ?
>  >
>  >
>  > And one more question:
>  >
>  > I am also trying to compile the same version of MapServer in my local
>  > machine (with Linux MInt) with the same cmake options and php version
>  > 7.2.26. But the compilation fails with the following errors:
>  >
>  > In file included from /usr/include/php/20190902/Zend/zend.h:27:0,
>  >                   from /usr/include/php/20190902/main/php.h:34,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript.h:35,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
>  > /usr/include/php/20190902/Zend/zend_types.h:665:0: note: this is the
>  > location of the previous definition
>  >   #define Z_ISREF_P(zval_p)   Z_ISREF(*(zval_p))
>  >   ^
>  > In file included from
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript.h:37:0,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript_util.h:71:0:
>  > warning: "Z_ISREF" redefined
>  >   #define Z_ISREF(z)            Z_ISREF_P(&(z))
>  >   ^
>  > In file included from /usr/include/php/20190902/Zend/zend.h:27:0,
>  >                   from /usr/include/php/20190902/main/php.h:34,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript.h:35,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
>  > /usr/include/php/20190902/Zend/zend_types.h:664:0: note: this is the
>  > location of the previous definition
>  >   #define Z_ISREF(zval)    (Z_TYPE(zval) == IS_REFERENCE)
>  >   ^
>  > In file included from
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript.h:37:0,
>  >                   from
>  > /usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
>  > /usr/local/src/mapserver/mapscript/php/php_mapscript_util.h:84:27:
>  > error: unknown type name ‘zend_uint’
>  >   static zend_always_inline zend_uint zval_refcount_p(zval* pz)
>  >
>  >
>  > Any help would be appreciated?
>  >
>  >
>  > Regards,
>  > Stefanos
> 
>  >
>  >
>  > _
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list