[mapserver-users] PHP_Mapscript swig issue on macOS.

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Nov 5 14:41:17 PST 2019


At least SWIG version 4.0 is recommended for PHP7 support (or git-master).

I also compile all mapserv dependencies from source on unix (such as 
Freetype, libpng, Harfbuzz, etc) as well as for GDAL, to avoid issues 
such as yours involving packages that you likely did not compile.

-jeff


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



On 2019-11-05 5:49 PM, djrob wrote:
> I am having the same issue on a RHEL7 server as the OP.  Using SWIG with PHP
> mapscript when I attempt to add a label with any font specified it fails to
> create the image and throws a fatal error.  If I leave the font parameter
> out of the label section of the map file the image is generated but without
> any text.
> 
> I did a little digging and found that the actual error being thrown is a
> FreeType error 0x021 or "invalid library handle" when the FT_New_Face
> function is called from within msGetFontFace in fontcache.c.  It appears
> that the font cache is not being properly initialized but unfortunately that
> is as far as I was able to troubleshoot.
> 
> I have tried with multiple locations of the fontset file and fonts
> themselves.  I have tried both full and relative paths to the fonts within
> the fonts.list file. Nothing seems to be able to resolve the issue.  Hoping
> someone can point me in the right direction.
> 
> Here are the pertinent details on my install.  I built the mapserv files
> from source, everything else was installed via yum from RedHat repositories.
> 
> MapServer version 7.4.2 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG
> SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI
> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI
> SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
> 
> PHP
> PHP 7.2.24 (cli) (built: Oct 30 2019 04:12:25) ( NTS )
> Copyright (c) 1997-2018 The PHP Group
> Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
> 
> SWIG
> SWIG Version 3.0.12
> Compiled with g++ [x86_64-redhat-linux-gnu]
> Configured options: +pcre
> 
> 



More information about the mapserver-users mailing list