[mapserver-users] PHP Mapscript on Debian 10

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Jun 14 04:38:48 PDT 2021


Hi Sven,

Native PHP MapScript is no longer supported (and will be removed for the 
MapServer 8.0 release).

Instead you must use SWIG MapScript support, so be sure to set 
-DWITH_PHPNG=ON in your cmake command.  SWIG >=4 is recommended for this.

You can then follow 
https://mapserver.org/MIGRATION_GUIDE.html#mapserver-7-2-to-7-4-migration to 
adjust your scripts.

-jeff



-- 
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/




On 2021-06-14 4:05 a.m., Sven Schroeter via mapserver-users wrote:
> Hi,
> 
> I am trying to get PHP Mapscript to run stably on a Debian 10 machine.
> The installation actually worked fine and everything is running, only 
> there is an error after each automatic nightly restart of the Apache 
> server.
> After that PHP continues to run, but the Mapscript module does not work 
> anymore.
> 
> This is the error message from Apache after the restart at night:
> 
> [Mon Jun 14 00:00:04.851967 2021] [mpm_prefork:notice] [pid 24101] 
> AH00171: Graceful restart requested, doing restart
> [Mon Jun 14 00:00:05.847274 2021] [mpm_prefork:notice] [pid 24101] 
> AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations
> [Mon Jun 14 00:00:05.847340 2021] [core:notice] [pid 24101] AH00094: 
> Command line: '/usr/sbin/apache2'
> [Mon Jun 14 00:00:06.934284 2021] [core:notice] [pid 24101] AH00052: 
> child pid 29129 exit signal Segmentation fault (11)
> 
> If I restart Apache manually after that everything runs normal again.
> 
> 
> I did the following installation of Mapscript and Mapserver:
> 
> 1. Installation Apache Postgres GDAL:
> apt-get -y install apache2 libapache2-mod-php postgresql-11-postgis-2.5 
> gdal-bin
> postgresql-11-ogr-fdw && apt-get clean
> 
> 2. PHP components:
> apt-get -y install php-pgsql php-gd php-curl php-mbstring php-sqlite3 
> php-zip phpsqlite3 php-bcmath php-xml && apt-get clean
> a2enmod cgi && systemctl restart apache2
> 
> 3. Mapserver 7.6x with PHP Mapscript - own compilation with cmake:
> 
> sudo apt-get install libfreetype6-dev php-dev libproj-dev libfribidi-dev
> libharfbuzz-dev libcairo-dev libgdal-dev libgpg-error-dev 
> libcurl4-openssl-dev
> libfcgi-dev
> 
> wget http://download.osgeo.org/mapserver/mapserver-7.6.3.tar.gz && /
> tar xvf mapserver-7.6.3.tar.gz && /
> cd mapserver-7.6.3/
> sudo apt-get install cmake
> mkdir build
> cd build
> 
> cmake -DCMAKE_INSTALL_PREFIX=/opt \
> -DCMAKE_PREFIX_PATH=/usr/local:/opt \
> -DWITH_CLIENT_WFS=ON \
> -DWITH_CLIENT_WMS=ON \
> -DWITH_WCS=ON \
> -DWITH_THREAD_SAFETY=ON \
> -DWITH_PHP=ON \
> -DWITH_KML=ON \
> -DWITH_GEOS=ON \
> -DWITH_GDAL=ON \
> -DWITH_OGR=ON \
> -DWITH_PROJ=ON \
> -DWITH_CAIRO=ON \
> -DWITH_POSTGIS=ON \
> -DWITH_CURL=ON \
> -DWITH_SOS=ON \
> -DWITH_XMLMAPFILE=0 \
> -DWITH_FCGI=ON \
> -DWITH_LIBXML2=ON \
> -DWITH_GIF=ON \
> -DWITH_FRIBIDI=0 \
> -DWITH_HARFBUZZ=0 \
> -DWITH_PROTOBUFC=0 \
> -DWITH_PYTHON=OFF \
> -DWITH_SVGCAIRO=OFF \
> ..
> make
> sudo make install
> echo extension=php_mapscript.so>/etc/php/7.3/mods-available/mapscript.ini
> 
> phpenmod mapscript
> service apache2 restart
> 
> after these installation steps I have a perfectly running PHP version 
> 7.3.27-1~deb10u1 with Mapscript (MapServer version 7.6.3) but as said 
> the Mapscript module error after every nightly restart of Apache.
> If I restart Apache manually after that everything runs normal again.
> I am now quite at a loss...
> 
> Thanks for any advice, unfortunately I am not a Debian (Linux) expert.
> 
> Sven
> 
> 
> 
> 
> After this
> 
> 
> 
> Greetings Sven
> 
> 






More information about the MapServer-users mailing list