[MS4W-Users] ms4w 4.0.0 PHP-Mapscript Test

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Feb 11 10:25:57 EST 2019


Hi Ludwig,

Thank you for your feedback.

As there are many changes as part of MS4W 4, be sure to always first 
check the documentation that is part of your local install: eg. for 
PHPmapscript see locally http://127.0.0.1/README_INSTALL.html#php

Make sure to follow all of the steps listed there, especially #5 to 
include the required file; I will paste those steps here for you to follow:

MapScript configuration
=======================

PHP
---

.. WARNING::

     As of the MS4W 4.0.0 release, PHPMapScript uses the `SWIG MapScript 
API <https://mapserver.org/mapscript/mapscript.html>`__.

1. PHPMapScript dll is located in ``/ms4w/Apache/php/ext``

2. PHP's configuration file "php.ini" is located in ``/ms4w/Apache/cgi-bin``

3. PHPMapScript is loaded by default

4. As of the MS4W 4.0.0 release, the PHPMapScript extension uses the 
SWIG MapScript API
    (see SWIG MapScript API docs at 
https://mapserver.org/mapscript/mapscript.html)

5. All of your PHP scripts must now always first include the 
``mapscript.php`` file
    containing MapServer constants:


     // required SWIG include (contains MapServer constants for PHP7)
     include("C:/ms4w/apps/phpmapscriptng-swig/include/mapscript.php");

6. Test this syntax with the provided quickmap.php file at 
``/ms4w/Apache/htdocs/quickmap.php``
    (see usage instructions in the top of that file)



Thank you for your interest in MS4W.

-jeff



On 2019-02-11 6:09 AM, ludwig--- via MS4W-Users wrote:
> Hi List,
> I installed a fresh version ms4w_4.0.0_beta1, Apache starts, phpinfo 
> shows "MapServer version 7.4.0-dev (MS4W 4.0.0)", looks fine, but the 
> first test of php-mapscript-functions had no success:
> ms_ResetErrorList();
> => "*Fatal error*: Uncaught Error: Call to undefined function 
> ms_ResetErrorList()"
> $ms_map_obj = new mapObj('e:\website\wver_ims_bak\mapserver\blank.map');
> => *"Fatal error*: Uncaught Error: Class 'mapObj' not found"
> Stopped further testing. Allthough phpinfo says, mapscript is available, 
> the mapscript-functions and -classes aren't recognized.
> By the way, same Scripts on debian (PHP 7.2 and MapScript MapServer 
> version 7.3-dev) run without problems...
> 
> _


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


More information about the MS4W-Users mailing list