我一直在尝试在我的restrcited(没有根)环境中编译地理,我遇到了一些困难……
我做了以下
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
我得到以下错误
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
据一些github说,这也发生在MAMP上
This happens because GEOS requires PHP header files from the original PHP source, and MAMP does not include those.
编辑1:
我还在〜/ local / share / config.site中添加了这个
CPPFLAGS=-I./opt/alt/php53/usr/include/
LDFLAGS=-L$HOME/local/lib
php.h位于:./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 / val / php53 /usr/include / php / Zend / zend_exceptions.h
编辑2:
最后一件事:我的./configure告诉我这个
checking for php-config... /usr/local/bin/php-config
checking for php... /usr/local/bin/php
所以我的问题是,如果我在正确的轨道上解决这个问题,那么如何在centOs中的非root evnironment中编译地理位置时如何包含我的php头文件?
老实说,我很丢失!