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

Error when compiled with PHP 7 #116

Open
TouriSpo opened this issue Dec 18, 2015 · 14 comments
Open

Error when compiled with PHP 7 #116

TouriSpo opened this issue Dec 18, 2015 · 14 comments

Comments

@TouriSpo
Copy link

Just tried to compile geoPHP with new PHP 7.0.1 version. Compiling fails with the following errors:

geos.c:159:8: error: unknown type name 'zend_object_value'
static zend_object_value
       ^
geos.c:161:5: error: unknown type name 'zend_objects_free_object_storage_t'
    zend_objects_free_object_storage_t st, zend_object_handlers* handlers)
    ^
geos.c:164:22: error: expected ';' after expression
    zend_object_value retval;
                     ^
                     ;
geos.c:164:5: error: use of undeclared identifier 'zend_object_value'
    zend_object_value retval;
    ^
geos.c:164:23: error: use of undeclared identifier 'retval'
    zend_object_value retval;

Is supporting PHP7 on your roadmap? Would be great to be able to update PHP and still use all the cool features of geoPHP.

Thanks for a short heads up
Martin

@collmomo
Copy link

+1

@mprins
Copy link
Contributor

mprins commented Feb 17, 2016

was your geos library compiled with php7 bindings?

@collmomo
Copy link

@collmomo
Copy link

The api changed. People says it takes at max 2 hour to change it to the new zend API. Unfortunately, I don't know C.

@BathoryPeter
Copy link

But it's not a GeoPhp bug, GEOS is an external library.

@rohan-deshpande
Copy link

Sorry to hijack this but has anyone managed to compile geos with bindings for php7? Huge blocking issue for the team I'm working with at the moment as we really need to move to php7 but this is a crucial lib for us. Any info would be really appreciated.

@sascha-hendel
Copy link

Any news on that issue?

@sascha-hendel
Copy link

Found a solution:
1st: Compile and install GEOS package without PHP bindings
2nd: Compile and install newest PHP bindings seperately ( https://git.osgeo.org/gogs/geos/php-geos )

@rohan-deshpande
Copy link

Yes we actually hired Sandro to do this work and it's working nicely

@matthewmummert5
Copy link

Is this library no longer maintained? This is an issue for me as well.

@Toilal
Copy link

Toilal commented Jun 16, 2017

Just use up to date geos bindings @matthewmummert5. I hit this issue with 3.4.2, but it works well with 3.6.1 and PHP bindings from https://git.osgeo.org/gogs/geos/php-geos.

curl -s -O http://download.osgeo.org/geos/geos-3.6.1.tar.bz2 &&\
  tar -xjvf geos-3.6.1.tar.bz2 &&\
  cd geos-3.6.1/ &&\
  ./configure --enable-php &&\
  make &&\
  make install &&\
  cd ..

ldconfig

curl -s -O https://git.osgeo.org/gogs/geos/php-geos/archive/master.tar.gz &&\
    tar -zxvf master.tar.gz &&\
    cd php-geos &&\
    ./autogen.sh &&\
    ./configure &&\
    make &&\
    make install &&\
    cd .. &&

@virgolamobile
Copy link

virgolamobile commented Sep 15, 2018

The master.tar.gz has moved here:

https://git.osgeo.org/gitea/geos/php-geos/archive/master.tar.gz

Updates procedure here:

curl -s -O http://download.osgeo.org/geos/geos-3.6.1.tar.bz2 &&\
  tar -xjvf geos-3.6.1.tar.bz2 &&\
  cd geos-3.6.1/ &&\
  ./configure --enable-php &&\
  make &&\
  make install &&\
  cd ..

ldconfig

curl -s -O https://git.osgeo.org/gitea/geos/php-geos/archive/master.tar.gz &&\
    tar -zxvf master.tar.gz &&\
    cd php-geos &&\
    ./autogen.sh &&\
    ./configure &&\
    make &&\
    make install &&\
    cd .. &&

@virgolamobile
Copy link

Note: ./autogen.sh refers to phpize. You have to install php7.x-dev

Example for php 7.1:

sudo apt-get install php7.1-dev

@danangponorogo
Copy link

Just tried to install geos on Centos 7.6, PHP 7.3.15

# yum install bzip2
# yum install gcc
# yum install php-devel
# wget http://download.osgeo.org/geos/geos-3.8.0.tar.bz2
# tar -xjvf geos-3.8.0.tar.bz2
# cd geos-3.8.0
# ./configure

on last command ( ./configure ) I'm stuck with the following errors:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for GEOS version... "3.8.0"
checking for GEOS CAPI version... "1.13.1"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/root/geos-3.8.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

Any help greatly appreciated. Thx

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

No branches or pull requests

10 participants