[MapServer-users] Swig Mapscript Still Fails to Build with PHP 8

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Sep 27 16:11:01 PDT 2022


Hi BG,

Thanks for starting this discussion here, as many other readers will 
help & learn from your situation; I first want to wish you a warm 
welcome from the MapServer community :)

As Seth mentioned, I spent a lot of effort setting up the automated PHP 
8 + MapServer 8 builds "on the cloud", and some of those steps can be 
used by you directly.

But to step back a bit, first thing to mention is that PHP 8 with 
MapServer 8 is best handled through the SWIG library "master" branch, 
and this is likely one of your issues (the Homebrew formula you are 
using for SWIG is probably SWIG 4.0.x, and you need the upcoming 4.1.0 
release, or build its master branch from source).

Regarding the SWIG 4.1.0 upcoming release (and its heavy demand), see my 
call for help at 
https://lists.osgeo.org/pipermail/mapserver-dev/2022-September/016881.html

Regarding you possibly compiling SWIG 'master' branch, you can follow my 
exact steps to do this on these lines: 
https://github.com/MapServer/MapServer/blob/main/ci/travis/before_install.sh#L38-L47 
(maybe other Mac devs can update those steps here in this discussion 
thread for you)

I personally think all this will take some time before all packagers 
catch up to these changes, to make it smooth for their users.  In this 
case some time is required before the next SWIG can be released, and 
then propagated to all those FOSS4G packages that we love.

Its for this exact reason that I have put almost my entire career into 
MS4W, to prevent users from facing these same build challenges (and 
there are many challenges, ha).

I'm not sure that I've helped with this response, other than giving you 
some background info.

Don't be discouraged, you will indeed fall in love with MapServer :)

Thanks,

-jeff




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






On 2022-09-27 12:39 p.m., b g wrote:
> Good morning,
> 
> I have been trying to build the MapServer 8.0 release using PHP 8. I am 
> a new user having only been working with MapServer for just a couple of 
> months, please forgive me I don't ask questions in the appropriate way.
> 
> I have seen posts on the Github referring to the new release as 
> supporting PHP 8 as mentioned here: 
> https://github.com/MapServer/MapServer/pull/6430 
> <https://github.com/MapServer/MapServer/pull/6430>**and here: 
> https://github.com/MapServer/MapServer/issues/6632 
> <https://github.com/MapServer/MapServer/issues/6632>. However, I fail to 
> see a post mentioning the steps of what I need to change in the build 
> process. My process is as follows: I install Homebrew and then install 
> the dependencies -- httpd php at 8.0 cmake pkg-config swig fcgi gd gdal 
> geos giflib postgresql proj protobuf-c proj at 7. After this I clone 
> MapServer from Github and checkout rel-8-0-0. Next, I run cmake with the 
> following options:
> 
> cmake ..  -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_FIND_FRAMEWORK=LAST 
> -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DWITH_CLIENT_WFS=ON 
> -DWITH_CLIENT_WMS=ON -DWITH_CURL=ON -DWITH_FCGI=ON -DWITH_FRIBIDI=OFF 
> -DWITH_GDAL=ON -DWITH_GEOS=ON -DWITH_HARFBUZZ=OFF -DWITH_KML=ON 
> -DWITH_OGR=ON -DWITH_POSTGIS=ON -DWITH_PROJ=ON -DWITH_PYTHON=OFF 
> -DWITH_SOS=ON -DWITH_WFS=ON -WITH_CAIRO=ON -DCMAKE_SKIP_RPATH=ON 
> -DWITH_PHPNG=ON -DCMAKE_INCLUDE_PATH="/usr/local/Cellar/postgresql"
> 
> And then make. However, make fails with errors referring to bindings 
> needing PHP 7. The error log is listed below:
> 
> 
> https://pastebin.com/99xWFcpE <https://pastebin.com/99xWFcpE>
> 
> 
> Clearly, I must be missing something or doing something wrong during the 
> build process since others have stated that version 8.0.0 works with PHP 
> 8. Could anyone be so kind to point out my error so that I could get 
> this to work? Any help is much appreciated. Thank you so much.
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list