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 · 58 comments
Closed

Support for PHP 7 #5252

sebastic opened this issue Feb 20, 2016 · 58 comments

Comments

@sebastic
Copy link
Contributor

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
Copy link

zek commented Apr 18, 2016

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

@samtux
Copy link

samtux commented Apr 19, 2016

Confirm the same error on Arch Linux for PHP7.

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

@sebastic
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Member

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

@oldbucsfan
Copy link

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
Copy link
Contributor

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

@jmckenna
Copy link
Member

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
Copy link

wbloos 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
Copy link
Contributor Author

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
Copy link

phowe 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
Copy link

PHP 7 MapScript is essential IMHO

@allartk
Copy link

allartk 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
Copy link
Contributor

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

@cjcliffe
Copy link

cjcliffe 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
Copy link
Member

tbonfort 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
Copy link
Contributor Author

sebastic commented Dec 5, 2016

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

@jmckenna
Copy link
Member

jmckenna 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
Copy link
Member

sdlime commented Dec 5, 2016 via email

@jmckenna
Copy link
Member

jmckenna commented Dec 5, 2016

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

@cjcliffe
Copy link

cjcliffe 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
Copy link
Member

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
Copy link
Contributor

👍 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
Copy link
Member

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

@bjoernboldt
Copy link
Contributor

bjoernboldt 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
Copy link

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

@humbertoibanez
Copy link

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
Copy link
Contributor

landryb commented Jun 24, 2018

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

@rouault
Copy link
Contributor

rouault commented Jun 24, 2018

@landryb PHP 7 is unsupported for MapServer 7.2

@AlexanderGabriel
Copy link
Contributor

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
Copy link
Contributor

landryb commented Jun 25, 2018

@landryb PHP 7 is unsupported for MapServer 7.2

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

@nboisteault
Copy link

@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
Copy link
Contributor

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
Copy link
Contributor

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

@geographika
Copy link
Member

geographika 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
Copy link
Contributor

ejn 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
Copy link
Contributor

landryb 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
Copy link
Contributor Author

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

@landryb
Copy link
Contributor

landryb 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
Copy link
Contributor

ejn 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
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

AlexanderGabriel commented Oct 18, 2018

The promised PR: #5682

@bbrala
Copy link

bbrala 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
Copy link

bbrala 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
Copy link

nospor 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
Copy link

bbrala 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
Copy link

nospor 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
Copy link

bbrala commented Oct 11, 2019 via email

@sebastic
Copy link
Contributor Author

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

@nospor
Copy link

nospor commented Oct 11, 2019

Ta guys. Will check your directions next week.

@pvi-github
Copy link

Hello all,
I tried to build and package mapserver & mapscript 7.4.3 on Mageia 7 with php 7.3
The package builds but when enabling php-mapscript or php-mapscript-ng php starts to encounter a lot of segmentation faults :-/

With gdb i managed to figure that the SIGSEV occurs in fe-misc.c but that might not be really helpful.

Do you have news about the behavior of php-mapscriptng or php-mapscriptng on Ubuntu or Debian ? (For Fedora its not yet enabled)

Kind regards,

@AlexanderGabriel
Copy link
Contributor

Hi PVi,

php-mapscript is available via backports for Debian Buster. I'm not using it but this is an easy way to use it without having to build it by youself.
phpinfo() on command line:
grafik

echo deb http://deb.debian.org/debian buster-backports main >> /etc/apt/sources.list
apt-get update
apt-get install php-mapscript
phpenmod mapscript
echo \<?php phpinfo\(\)\; > phpinfo.php
php -f phpinfo.php | grep -i mapscript

Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests