Compiling geostats without root CentOS

I am trying to compile geo objects in my limited (without root) environment, and I am having some difficulties ...

I did the following

wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 tar jxf geos-3.4.2.tar.bz2 cd geos-3.4.2 nano ~/.bash_profile # I added PATH=$PATH:$HOME/local/bin export PATH ./configure --enable-php --prefix=$HOME/local/ && make clean && make 

And I get the following errors

 Making all in php make[2]: Entering directory `/home/myname/test/geos-3.4.2/php' Making all in . make[3]: Entering directory `/home/myname/test/geos-3.4.2/php' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I../include/geos `/usr/local/bin/php-config --includes` -DCOMPILE_DL_GEOS -I../capi -I../include -I./opt/alt/php53/usr/include/ -pedantic -Wall -ansi -Wno-long-long -ffloat-store -std=gnu99 -g -O2 -MT geos_la-geos.lo -MD -MP -MF .deps/geos_la-geos.Tpo -c -o geos_la-geos.lo `test -f 'geos.c' || echo './'`geos.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../include -I../include/geos -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DCOMPILE_DL_GEOS -I../capi -I../include -I./opt/alt/php53/usr/include/ -pedantic -Wall -ansi -Wno-long-long -ffloat-store -std=gnu99 -g -O2 -MT geos_la-geos.lo -MD -MP -MF .deps/geos_la-geos.Tpo -c geos.c -fPIC -DPIC -o .libs/geos_la-geos.o geos.c:26:17: error: php.h: No such file or directory geos.c:27:54: error: ext/standard/info.h: No such file or directory geos.c:28:72: error: Zend/zend_exceptions.h: No such file or directory 

According to some github, this happens with MAMP

This is because GEOS requires PHP header files from the original PHP source, and MAMP does not include them.

EDIT 1:

I also added this to ~ / local / share / config.site

 CPPFLAGS=-I./opt/alt/php53/usr/include/ LDFLAGS=-L$HOME/local/lib 

php.h is here: ./opt/alt/php53/usr/include/php/main/php.h

info.h: ./opt/alt/php53/usr/include/php/ext/standard/info.h

zend_exceptions.h: ./opt/alt/php53/usr/include/php/Zend/zend_exceptions.h

EDIT 2:

Last: mine. / configure tells me this

 checking for php-config... /usr/local/bin/php-config checking for php... /usr/local/bin/php 

So my question, if Im on the right track to solve this, is how can I include my php header files while compiling geolocations in un root evnironment in centOs?

I'm completely lost to be honest!

+5
source share
1 answer

I am sure that the path to your PHP installation does not start with . , and not from within the geos-3.4.2 folder, and, of course, from within an arbitrary source folder.
You must make this path absolute.

I assume that the opt folder is in your user folder, so the full path will be $HOME/opt/alt/php53/usr/ . Thanks for the clarification, the full path should be /opt/alt/php53/usr/ .
You need to add the bin folder to your PATH variable, the include folder to the CPPFLAGS folder and lib to LDFLAGS .
With $HOME/local/ this is optional since it is PREFIX and will be added automatically.
Also note that when adding material to the PATH variable, you must add it to the beginning , not the end, so that it takes precedence over system binaries.

I also suggest that you undo the changes you made to ~/local/share/config.site (or delete the file if it does not exist), since the parameters will affect all projects based on automake.
You better pass CPPFLAGS and LDFLAGS as arguments to configure .

After that, your command block should look something like this:

 wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 tar jxf geos-3.4.2.tar.bz2 cd geos-3.4.2 export PATH="/opt/alt/php53/usr/bin:$PATH" ./configure --enable-php --prefix="$HOME/local" CPPFLAGS="-I/opt/alt/php53/usr/include" LDFLAGS="/opt/alt/php53/usr/lib" && make clean && make 
+1
source

All Articles