Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PHP 7 #5252

Closed
sebastic opened this issue Feb 20, 2016 · 56 comments

Comments

@sebastic
Copy link
Contributor

commented Feb 20, 2016

Ubuntu has disabled support for PHP in their mapserver package because they have switched to PHP 7 for the xenial LTS release.

Debian will also switch to PHP 7 for the stretch release, hence PHP mapscript will be disabled as long as it doesn't support PHP 7.

The extension API changes are documented on the PHP Wiki:
Upgrading PHP extensions from PHP5 to NG

Switching the build to the default PHP (via php-dev) results in this build failure:

[ 78%] Building C object mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.o
cd /build/mapserver-7.0.0/obj-x86_64-linux-gnu/mapscript/php && /usr/bin/cc  -DCOMPILE_DL=1 -Dphp_mapscript_EXPORTS -I/build/mapserver-7.0.0/obj-x86_64-linux-gnu -I/build/mapserver-7.0.0/renderers/agg/include -I/build/mapserver-7.0.0/mapscript/v8 -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/cairo -I/usr/include/postgresql -I/usr/include/gdal -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -Wdate-time -D_FORTIFY_SOURCE=2  -Wall -Wdeclaration-after-statement -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/php_mapscript.dir/mapscript_error.c.o   -c /build/mapserver-7.0.0/mapscript/php/mapscript_error.c
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:62:0: warning: "Z_ISREF_P" redefined
 #define Z_ISREF_P(pz)         zval_isref_p(pz)
 ^
In file included from /usr/include/php/20151012/Zend/zend.h:31:0,
                 from /usr/include/php/20151012/main/php.h:36,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_types.h:498:0: note: this is the location of the previous definition
 #define Z_ISREF_P(zval_p)   Z_ISREF(*(zval_p))
 ^
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/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/20151012/Zend/zend.h:31:0,
                 from /usr/include/php/20151012/main/php.h:36,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_types.h:497:0: note: this is the location of the previous definition
 #define Z_ISREF(zval)    (Z_TYPE(zval) == IS_REFERENCE)
 ^
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/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)
                           ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:84:37: error: conflicting types for 'zval_refcount_p'
 static zend_always_inline zend_uint zval_refcount_p(zval* pz)
                                     ^
In file included from /usr/include/php/20151012/Zend/zend.h:31:0,
                 from /usr/include/php/20151012/main/php.h:36,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_types.h:810:36: note: previous definition of 'zval_refcount_p' was here
 static zend_always_inline uint32_t zval_refcount_p(zval* pz) {
                                    ^
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_refcount_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:86:12: error: 'zval {aka struct _zval_struct}' has no member named 'refcount'
   return pz->refcount;
            ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: At top level:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:89:27: error: unknown type name 'zend_uint'
 static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc)
                           ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:89:67: error: unknown type name 'zend_uint'
 static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc)
                                                                   ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:94:27: error: unknown type name 'zend_uint'
 static zend_always_inline zend_uint zval_addref_p(zval* pz)
                           ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:94:37: error: conflicting types for 'zval_addref_p'
 static zend_always_inline zend_uint zval_addref_p(zval* pz)
                                     ^
In file included from /usr/include/php/20151012/Zend/zend.h:31:0,
                 from /usr/include/php/20151012/main/php.h:36,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_types.h:820:36: note: previous definition of 'zval_addref_p' was here
 static zend_always_inline uint32_t zval_addref_p(zval* pz) {
                                    ^
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_addref_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:96:14: error: 'zval {aka struct _zval_struct}' has no member named 'refcount'
   return ++pz->refcount;
              ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: At top level:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:99:27: error: unknown type name 'zend_uint'
 static zend_always_inline zend_uint zval_delref_p(zval* pz)
                           ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:99:37: error: conflicting types for 'zval_delref_p'
 static zend_always_inline zend_uint zval_delref_p(zval* pz)
                                     ^
In file included from /usr/include/php/20151012/Zend/zend.h:31:0,
                 from /usr/include/php/20151012/main/php.h:36,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_types.h:825:36: note: previous definition of 'zval_delref_p' was here
 static zend_always_inline uint32_t zval_delref_p(zval* pz) {
                                    ^
In file included from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:37:0,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_delref_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:101:14: error: 'zval {aka struct _zval_struct}' has no member named 'refcount'
   return --pz->refcount;
              ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_isref_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:106:12: error: 'zval {aka struct _zval_struct}' has no member named 'is_ref'
   return pz->is_ref;
            ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_set_isref_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:111:12: error: 'zval {aka struct _zval_struct}' has no member named 'is_ref'
   return pz->is_ref = 1;
            ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_unset_isref_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:116:12: error: 'zval {aka struct _zval_struct}' has no member named 'is_ref'
   return pz->is_ref = 0;
            ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: In function 'zval_set_isref_to_p':
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:121:12: error: 'zval {aka struct _zval_struct}' has no member named 'is_ref'
   return pz->is_ref = isref;
            ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h: At top level:
/build/mapserver-7.0.0/mapscript/php/php_mapscript_util.h:261:1: error: unknown type name 'zend_object_value'
 zend_object_value mapscript_object_new(zend_object *zobj,
 ^
In file included from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:0:
/build/mapserver-7.0.0/mapscript/php/php_mapscript.h:461:8: error: unknown type name 'zend_object_value'
 extern zend_object_value mapscript_object_new(zend_object *zobj, zend_class_entry *ce,
        ^
/build/mapserver-7.0.0/mapscript/php/php_mapscript.h:463:8: error: unknown type name 'zend_object_value'
 extern zend_object_value mapscript_object_new_ex(zend_object *zobj, zend_class_entry *ce,
        ^
/build/mapserver-7.0.0/mapscript/php/mapscript_error.c: In function 'mapscript_throw_exception':
/build/mapserver-7.0.0/mapscript/php/mapscript_error.c:53:10: warning: return from incompatible pointer type [-Wincompatible-pointer-types]
   return zend_throw_exception(mapscript_ce_mapscriptexception, message, 0 TSRMLS_CC);
          ^
/build/mapserver-7.0.0/mapscript/php/mapscript_error.c: In function 'zm_startup_mapscript_error':
/build/mapserver-7.0.0/mapscript/php/mapscript_error.c:114:37: error: too many arguments to function 'zend_register_internal_class_ex'
   mapscript_ce_mapscriptexception = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), "Exception" TSRMLS_CC);
                                     ^
In file included from /usr/include/php/20151012/main/php.h:40:0,
                 from /build/mapserver-7.0.0/mapscript/php/php_mapscript.h:35,
                 from /build/mapserver-7.0.0/mapscript/php/mapscript_error.c:32:
/usr/include/php/20151012/Zend/zend_API.h:290:28: note: declared here
 ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce);
                            ^
mapscript/php/CMakeFiles/php_mapscript.dir/build.make:65: recipe for target 'mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.o' failed
@zek

This comment has been minimized.

Copy link

commented Apr 18, 2016

I need it too. We use php7 in our all servers.

@samtux

This comment has been minimized.

Copy link

commented Apr 19, 2016

Confirm the same error on Arch Linux for PHP7.

https://aur.archlinux.org/packages/mapserver/

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2016

As reported in the SWIG issue about PHP 7 support, Francois Laupretre wrote pecl-compat, "a set of C include files whose objective is to minimize the pain of making a PHP extension compatible with PHP 5 and 7".

That may be worth considering for PHP MapScript too.

@jmckenna

This comment has been minimized.

Copy link
Member

commented Jun 30, 2016

Checking progress on this. I thought I saw a partial patch posted somewhere...I just want to make sure that this ticket has all of the actual progress.

@jmckenna jmckenna added this to the 7.2 Release milestone Jun 30, 2016
@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Jun 30, 2016

The partial patch was perhaps the one in the GeoMoose issue for OSGeo-Live, I've not pursued that further because I don't have enough experience with the PHP and MapScript APIs.

@jmckenna

This comment has been minimized.

Copy link
Member

commented Jun 30, 2016

Thanks, that was it. Thank you for referring to it here.

@oldbucsfan

This comment has been minimized.

Copy link

commented Jun 30, 2016

MS4W also has been updated recently to be PHP7 compliant with everything except php_mapscript.
http://ms4w.com/trac/ticket/51
http://ms4w.com/trac/ticket/67

More info here: http://lists.ms4w.com/pipermail/ms4w-users/2016-June/000087.html

@astroidex

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2016

@jmkenna - how is the status? Do you know how much funding is needed?

@jmckenna

This comment has been minimized.

Copy link
Member

commented Sep 22, 2016

Although the changes in the "PHPNG - Next Generation" wiki look straight forward, the issue is that these changes must be applied for each of mapscript's custom objects. It is much effort. I have already been looking at this on Windows. I would need much more time to really work on this and debug the issues that come up.

I am following the SWIG ticket closely, and unfortunately there has been no progress there (to enhance SWIG to support PHP7). I feel that we must proceed to adapt mapscript for PHP7, as waiting for SWIG to adopt it could be a long time away.

@wbloos

This comment has been minimized.

Copy link

commented Sep 26, 2016

We need this too, or we can't upgrade our Ubuntu servers. A contribution to the funding might be possible.
I think that if this were fixed, it would not go into Ubuntu 16.04 LTS. So we will probably be needing a PPA or something similar.

Also Debian stretch will be in a "transition freeze" from 2016-11-05 and "soft freeze" (no new packages) from 2017-01-05. It would be a good thing to make it into stretch.

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2016

From the PHP 7 transition: PHP support removed from GEOS & MapServer thread on the debian-gis list:

The lack of PHP MapScript affects significantly more users. [4]

If PHP support 7 materializes in the next 6 months, we can get php-geos
& php-mapscript back in stretch, but for xenial it's already too late.

UbuntuGIS can play a role here to provide the packages for xenial with
PHP support once that's available again.

In case PHP 7 support is not available in time for the stretch release,
we can reintroduce php-mapscript via backports, but geos backports are
unlikely to happen.

With the lack of progress in both SWIG and PHP MapScript it's quite certain that both won't be ready in time for inclusion in the upcoming Debian stable release. That means no PHP MapScript for Debian stretch users just like Ubuntu xenial users. This has so far not triggered the affected users to contribute to PHP 7 support in PHP MapScript.

Regarding UbuntuGIS and the suggestion it provides mapserver builds with PHP 7 support once that's available, there is a lack of manpower in the UbuntuGIS team so those mapserver builds are not likely to appear unless the manpower issue is addressed.

@phowe

This comment has been minimized.

Copy link

commented Sep 30, 2016

We're another user that needs php7 support. @jmckenna - you understand the issues involved. And I agree that waiting for SWIG would not be practical. Could you estimate the amount of time needed to make the changes and debug? What skills (and level of experience with MapServer) would contributing developers need? It may be that my team could devote some time to this - but it depends on the time investment needed.

@cassiel74

This comment has been minimized.

Copy link

commented Oct 27, 2016

PHP 7 MapScript is essential IMHO

@allartk

This comment has been minimized.

Copy link

commented Nov 27, 2016

I follow this issue for a while and want to share my thought for a work-a-round.

To make the mapfile contents dynamic, you could use xml mapfiles. http://mapserver.org/development/rfc/ms-rfc-51.html
Php (and other popular script languages like python3, nodejs) has excellent tools to manipulate xml files. The resulting xml file could be stored in a temporary file, or cached for re-usage. The resulting file can be used by mapserver cgi like normal.

Sadly, i think you need to rewrite your mapfiles (but that may be less work as writing a new mapscript) , but someone could write a converter :).

@astroidex

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2016

Hi Jeff, is there any news about mapscript for PHP7?

@cjcliffe

This comment has been minimized.

Copy link

commented Dec 5, 2016

We need PHP7 support at our company as well, and I'm available to spend some time on it.

I've been looking into writing a replacement PHP extension using native PHPNG but don't want to go in a direction that might not be accepted.

Let me know what I can do to help.

@tbonfort

This comment has been minimized.

Copy link
Member

commented Dec 5, 2016

@cjcliffe go for it! We need to make this happen, as for now any solution that allows exisiting php mapscript scripts to run is better than the current situation. Aiming for a 7.2 milestone, I would be fine if you were to target php >= 7 only (unless you need 5.x compatibility for yourself of course).
Please keep us updated on your progress.

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Dec 5, 2016

@cjcliffe, but please coordinate with @jmckenna who is also working on this issue.

@jmckenna

This comment has been minimized.

Copy link
Member

commented Dec 5, 2016

Hi all. After spending too much time changing the existing code for PHP 7 (unfortunately the PHP "Next Generation" docs are very very slim) and running into problems, I noticed the mini-announcement of a development version of SWIG with PHP 7 support, and dove in. The hardest/impossible part for me was that SWIG on Windows requires a full MING32/MSYS build environment, but I somehow made it through that, and was able to compile a "working" mapscript.dll for PHP 7. I was able to get a small PHP7 script to generate a map image from a mapfile, in the browser. Good!

More work is to be done before I can post the steps, for Unix etc, and make it all work with cmake (cringe), hence why I was quiet. But seeing the discussion here today, I was forced to mention this now.

I think the teamwork can come in for helping to port the various "interface" functions (from the old "php_mapscript.c") into the SWIG wrapper.

As was discussed in a past PSC meeting, using SWIG with PHP is better in the long run (when PHP again changes its core we won't ever be in this situation again); but it will mean some breakages in old scripts, so this would definitely be for a major release like 7.2.

Anyway, sorry for not posting anything (but you can imagine my joy, I actually yelled out loud, when I saw a simple map image of Canada in my browser, with PHP 7 - I was never so happy to see a map in my life ha), but hopefully this explains things.

Of course, another custom-built PHP extension for PHP 7 could be created, but, we'll just be in the same spot again, 10 years from now.

Hope this helps (not hinders) discussions here.

@sdlime

This comment has been minimized.

Copy link
Member

commented Dec 5, 2016

@jmckenna

This comment has been minimized.

Copy link
Member

commented Dec 5, 2016

Steve you are right, it absolutely requires an RFC, it will really help discussion. I'll draft one.

@cjcliffe

This comment has been minimized.

Copy link

commented Dec 8, 2016

@jmckenna Glad to hear you've made progress; I managed to get the SWIG /w PHP7 support built on Linux here but hadn't gone much further. Sounds like it's still the best option if we don't want to have to re-do this when they inevitably make a new PHP interface.

@jmckenna

This comment has been minimized.

Copy link
Member

commented Dec 16, 2016

I've created an initial draft of the RFC at http://mapserver.org/development/rfc/ms-rfc-117.html Will bring this to the PSC, and also discuss this at the next PSC meeting (19 January).

@tigerfoot

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2017

👍 for the draft.
In the meantime the php group has release version 7.1.1 :-)
I'm looking forward to check build for all those python2,3 php5,7 all in swig all installabled at same time.
7.2 looks really awesome.

@jmckenna

This comment has been minimized.

Copy link
Member

commented Jan 19, 2017

@tigerfoot thanks for the positive feedback. And yes, I got those PHP 7.1.1 notifications too :)

@bjoernboldt

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2017

While PHP7 Mapscript with SWIG is still in development, i mad the job with C: https://github.com/bjoernboldt/mapscript-php7
I hope it's help sombody.

@waynermaia

This comment has been minimized.

Copy link

commented May 31, 2017

Hi Jeff, is there any news about mapscript for PHP7? :D

@bjoernboldt

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

I made a pull request #5461 today. It was never compiled with Windows by myself, I only have tried Ubuntu. So let's see what the others say.

@AlexanderGabriel

This comment has been minimized.

Copy link
Contributor

commented Nov 4, 2017

i can confirm, bjoernholdts fork compiles on Debian-9.2.
But... It does not compile on Windows.
After applying commit 6c09697 it compiles without mapscript. When trying to compile with Mapscript and PHP 7.1.9 i get the following errors:

Scanning dependencies of target php_mapscript
[ 82%] Building C object mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.obj
mapscript_error.c
C:\dev\work\php-sdk\phpdev\vc14\x86\php-7.1.9-src\win32/ioutil.h(495): warning C4018: '>': signed/unsigned mismatch
c:\dev\work\mapserver\mapserver.h(104): warning C4005: 'vsnprintf': macro redefinition
c:\dev\work\php-sdk\phpdev\vc14\x86\php-7.1.9-src\main\snprintf.h(113): note: see previous definition of 'vsnprintf'
c:\dev\work\mapserver\mapserver.h(170): warning C4005: 'snprintf': macro redefinition
c:\dev\work\php-sdk\phpdev\vc14\x86\php-7.1.9-src\main\snprintf.h(108): note: see previous definition of 'snprintf'
c:\dev\work\mapserver\mapserver.h(2251): warning C4028: formal parameter 3 different from declaration
c:\dev\work\mapserver\mapserver.h(2251): warning C4273: '_strnicmp': inconsistent dll linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\string.h(273): note: see previous definition of '_strnicmp'
c:\dev\work\mapserver\mapserver.h(2259): warning C4273: 'php_strlcat': inconsistent dll linkage
c:\dev\work\php-sdk\phpdev\vc14\x86\php-7.1.9-src\main\php.h(133): note: see previous definition of 'php_strlcat'
c:\dev\work\mapserver\mapserver.h(2263): warning C4273: 'php_strlcpy': inconsistent dll linkage
c:\dev\work\php-sdk\phpdev\vc14\x86\php-7.1.9-src\main\php.h(125): note: see previous definition of 'php_strlcpy'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(51): warning C4003: not enough actual parameters for macro '_ADDRESSOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(51): warning C4003: not enough actual parameters for macro '_INTSIZEOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(51): error C2059: syntax error: ')'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(80): warning C4003: not enough actual parameters for macro '_ADDRESSOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(80): warning C4003: not enough actual parameters for macro '_INTSIZEOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(80): error C2059: syntax error: ')'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(94): warning C4003: not enough actual parameters for macro '_ADDRESSOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(94): warning C4003: not enough actual parameters for macro '_INTSIZEOF'
C:\dev\work\mapserver\mapscript\php\mapscript_error.c(94): error C2059: syntax error: ')'
NMAKE : fatal error U1077: 'C:\PROGRA2\MICROS2.0\VC\bin\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

I use cmake and VS2015 Community Edition to build.
It has something to do with Thread-Safety and these lines from mapscript_error.c:
grafik

I tried to solve this but this is far beyond my skills. If someone can have a look at this and help me solve this, i can try to compile it again and maybe, we can get this running again. That would be really cool!

@humbertoibanez

This comment has been minimized.

Copy link

commented Mar 12, 2018

The @bjoernboldt branch compiled into Debian 9, Php 7.0.27-0 + deb9u1, but when loading the generated library: php_mapscript.so, it gave me an internal server error, without any logging. So I decided to use Docker with Debian 8 and Php 5.6.

bob-beck pushed a commit to openbsd/ports that referenced this issue May 22, 2018
a noop for now until the button is pushed in php.port.mk

pear-MDB2-mysql: requires php-mysql
nedi:		 requires php-mysql (fixable by updating to nedi 1.6)
mapserver:	 mapserver/mapserver#5252
xcache:		 not ported to 7.0; opcache recommended instead
@landryb

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2018

Are there plans to fix the build for 7.2, or should packagers not bother with the php bits ?

@rouault

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2018

@landryb PHP 7 is unsupported for MapServer 7.2

@AlexanderGabriel

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2018

After merging #5461 it should work on linux again but not windows.
i found a way via swig #5623 and did not try to fix native php mapscript on windows since november.

hope, both get accepted and support will be back soon.

@landryb

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2018

@landryb PHP 7 is unsupported for MapServer 7.2

oki, that's what i wanted to know - thanks !

@nboisteault

This comment has been minimized.

Copy link

commented Jun 25, 2018

@rouault Does it mean PHP 7.x mapscript will never be supported or it will be when developers will get paid for this task ?

@AlexanderGabriel

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2018

maybe i'm getting something wrong but all work is already done.
all "the developers" have to do is accept the pull-request #5461 and #5623 and php-mapscript will work again...
ether native with the old module you all already know or via swig.
last one is even working on windows.

@astroidex

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2018

Hello all. How is the status?
Did someone check #5461 already and will it be in the next version?

@geographika

This comment has been minimized.

Copy link
Member

commented Sep 28, 2018

I can review/test #5642 if someone wants to review #5461 we can get these included for the next release?

I presume we can then drop the 5.5 and 5.6 PHP CI tests in Travis (which would speed up test builds): https://travis-ci.org/mapserver/mapserver/builds/416091387

@ejn

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2018

In my opinion it would be best if PHP 5.6 still gets tested as the last PHP 5 version, since one of the benefits of this patch should be that both PHP5 and PHP7 are supported (whereas the SWIG-based PHPNG I assume will be PHP7 only), but 5.5 could definitely be dropped.

@landryb

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

per http://php.net/supported-versions.php PHP 5.6 & 7.0 are EOL upstream at the end of the year, imo it'd be a waste of time (and doing a disservice to users in terms of security) to keep supporting them.

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Oct 18, 2018

PHP 5.x & 7.0 are still supported in distributions like Debian jessie & stretch, Ubuntu trusty & xenial, and CentOS 6.

@landryb

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

PHP 5.x & 7.0 are still supported in distributions like Debian jessie & stretch, Ubuntu trusty & xenial, and CentOS 6.

I know, and i get your point, but those maintainance-only/LTS distributions won't upgrade mapserver to a new version supporting only php > 7.1 in the master branch... oh well. It's just more pain to support a bazillion of phps.

@ejn

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

@landryb A lot of distros don't have any Mapserver packages anyway (Debian & derivatives excepted), and so to help anyone compiling their own Mapserver (perhaps to get some of the other new features and bugfixes) it makes sense to me to at least check that some PHP 5.x version still works - at least so long as it's not making that much extra work.

(note that RHEL7 supports PHP 5.4 until > 2024 and afaik doesn't offer an official Mapserver package that will be supported that long)

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Oct 18, 2018

Those distribution are unlikely to upgrade their mapserver packages, but users of those distributions may choose to build mapserver from source themselves.

The mapserver Debian package is backported to Debian stretch, and via OSGeoLive also to Ubuntu xenial in the UbuntuGIS PPA.

@AlexanderGabriel

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

Hi,

i'm working on making the old "native" php-mapscript work again in this moment. the patches from @bjoernboldt from #5461 work fine in non-thread-safe environment (windows and linux, using apache with prefork or use php as cgi) but not in thread-safe-environment. but this is not a problem any more. thread-safety isnt even needed because there are no module global variables so i could fix my problems from november last year by removing the unneeded and error-throwing code and i can build native php-mapscript on windows and linux now and even travis build (see https://travis-ci.org/AlexanderGabriel/mapserver/builds/442965494 ) works with PHP5.6, 7, 7.1 and 7.2.

don't want to promise too much. i'm doing this in my spare time and mapserver team has to merge all that when i'm finished but i'm figuring out a few last little things, cleen up a little bit and will hopefully open a new PR the next days containing the work from @bjoernboldt and me.

if anyone wants to play around in the meanwhile, get the code from here: https://github.com/AlexanderGabriel/mapserver/ but this is very volatile in the moment. please use Branch PHP7Native and Commit AlexanderGabriel@fb989f7

And please note the discussion about php-mapscript on mapserver-dev mailing list.

@AlexanderGabriel

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

The promised PR: #5682

@bbrala

This comment has been minimized.

Copy link

commented Jan 3, 2019

@AlexanderGabriel thanks for making this happen. I see #5687 has been merged, which is awesome. Does anyone know what kind of timeline we would be looking at for release?

@bbrala

This comment has been minimized.

Copy link

commented Jan 15, 2019

Ok, seems like the release plan is here; https://github.com/mapserver/mapserver/wiki/MapServer-7.4-Release-Plan

tldr; hopefully around april 1st 2019

@nospor

This comment has been minimized.

Copy link

commented Oct 11, 2019

Hi guys, so silly question: is it done/working already? I tried to install it in my php7 with commands
apt-get install php-mapscript
or
apt-get install php7-mapscript

But it can find nothing. :(

With php5 I just run
apt-get install php5-mapscript
and it works.

@bbrala

This comment has been minimized.

Copy link

commented Oct 11, 2019

That mostly is related to the pository you are fetching from, if i look at https://github.com/mapserver/mapserver/blob/master/HISTORY.TXT it seems like it might be working now?

@nospor

This comment has been minimized.

Copy link

commented Oct 11, 2019

Ok, so anyone knows maybe from what repo I could fetch it? Or maybe I must compile it by myself to make it work now?

@bbrala

This comment has been minimized.

Copy link

commented Oct 11, 2019

@sebastic

This comment has been minimized.

Copy link
Contributor Author

commented Oct 11, 2019

php-mapscript was re-enabled in mapserver (7.4.0~beta1-1~exp1).

Ubuntu eoan is the first release to have php-mapscript again (and php-mapscript-ng for the first time), see:

https://launchpad.net/ubuntu/+source/mapserver

Since the GIS packages aren't actively maintained in Ubuntu, building it yourself is good option.
Adding an UbuntuGIS PPA is also an option, but the number of packages it contains is much more invasive, and not all reverse dependencies of the core libraries like GDAL have rebuilds in the PPA.

In Debian were the GIS packages are actively maintained, MapServer 7.4.2 is available for buster via backports, see:

https://tracker.debian.org/pkg/mapserver

@sebastic sebastic closed this Oct 11, 2019
@nospor

This comment has been minimized.

Copy link

commented Oct 11, 2019

Ta guys. Will check your directions next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.