I'm adding postgres support to PHP on OS X Mavericks (10.9.4).
Followed steps from [blog] (http://blog.rupey.org/post/63221360055/adding-postgres-support-to-php-on-os-x-mavericks)... fixed in between errors, and, reached till 'make'.
While performing 'make' I get the below error.
------ERROR------
users-mbp:pdo_pgsql RK$ pwd
/usr/include/php/ext/pdo_pgsql
users-mbp:pdo_pgsql RK$ make
/bin/sh /usr/include/php/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext -I. -I/usr/include/php/ext/pdo_pgsql -DPHP_ATOM_INC -I/usr/include/php/ext/pdo_pgsql/include -I/usr/include/php/ext/pdo_pgsql/main -I/usr/include/php/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Applications/Postgres.app/Contents/Versions/9.3/include -DHAVE_CONFIG_H -g -O2 -c /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c -o pdo_pgsql.lo
cc -I/usr/include/php/ext -I. -I/usr/include/php/ext/pdo_pgsql -DPHP_ATOM_INC -I/usr/include/php/ext/pdo_pgsql/include -I/usr/include/php/ext/pdo_pgsql/main -I/usr/include/php/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Applications/Postgres.app/Contents/Versions/9.3/include -DHAVE_CONFIG_H -g -O2 -c /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c -fno-common -DPIC -o .libs/pdo_pgsql.o
In file included from /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c:25:
In file included from /usr/include/php/main/php.h:34:
/usr/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found
# include <zend_config.h>
^
1 error generated.
make: *** [pdo_pgsql.lo] Error 1
users-mbp:pdo_pgsql RK$
------ERROR------}
But, I could locate the files in the below directories:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/Zend/zend.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php/Zend/zend.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/Zend/zend_config.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php/Zend/zend_config.h
Saw a similar issue under [post] (Having problems while try to install OAUTH with PECL in MAMP on mac OS lion).
-which suggests:
If you get the following /Applications/MAMP/bin/php/php5.4.4/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found make sure you configure php sources. i.e. in the directory where you copied all the files run ./configure – greg Jan 19 '13 at 2:41
Though, I've already run ./configure, the above error still occurs.
Can help me understand what am I missing?
Thanks in advance!
so I found a solution that worked for me.
Head on over to your terminal and type
"sudo cp -r /usr/include/php /Applications/MAMP/bin/php/php5.x.x/include/"
Replace the bold lettering with the version of php you're using
then run the make command
Related
I've recently updated to XAMPP 7.4.11, running on Mac Catalina 10.15.7. PHP-Intl does not come installed with XAMPP. Previously, I've been able to download the corresponding PHP version and intialize the Intl code – not this time.
When I attempt to 'make' intl, I receive the following error:
/bin/sh /Users/SLaptop/Downloads/php-7.4.11/ext/intl/libtool --mode=compile cc -I##BITROCK_COMMON_ROOTDIR##/include -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -DPHP_ATOM_INC -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/include -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/main -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -c /Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c -o collator/collator_sort.lo
cc -I##BITROCK_COMMON_ROOTDIR##/include -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_HIDE_OBSOLETE_UTF_OLD_H=1 -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -DPHP_ATOM_INC -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/include -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl/main -I/Users/SLaptop/Downloads/php-7.4.11/ext/intl -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -c /Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c -fno-common -DPIC -o collator/.libs/collator_sort.o
/Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c:349:26: error:
use of undeclared identifier 'TRUE'
collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
^
/Users/SLaptop/Downloads/php-7.4.11/ext/intl/collator/collator_sort.c:543:26: error:
use of undeclared identifier 'FALSE'
collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
^
2 errors generated.
make: *** [collator/collator_sort.lo] Error 1
I see several users have experienced issues with PHP-Intl in the past. There doesn't appear to be a consistent remedy, though. Does anyone have any suggestions for this beginner?
Ok, I was able to come up with a solution. It wasn't pretty, though.
PHP-Int has separated out ICU utilities, making the extension difficult to add to XAMPP’s installed version of PHP.
I was able to do it this time by using Macports, in Mac's CLI:
sudo port install php74-intl
then, go to
/opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so [php folder may have a number, like php74]
copy the intl.so file into
/Applications/xampp/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/ [date will vary]
Change the PHP.ini file to include the intl.so file.
And it worked ... this time, anyway!
I try to install Yaml 1.3.2 in my device which is has 5.6 enable php version...
After Execute this command sudo pecl install yaml-1.3.2 I got this error:
creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/libtool --mode=compile cc -I. -I/tmp/pear/temp/yaml -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/include -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/main -I/tmp/pear/temp/yaml -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/yaml/yaml.c -o yaml.lo
mkdir .libs
cc -I. -I/tmp/pear/temp/yaml -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/include -I/tmp/pear/temp/pear-build-rootlbrA1X/yaml-1.3.2/main -I/tmp/pear/temp/yaml -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/yaml/yaml.c -fPIC -DPIC -o .libs/yaml.o
In file included from /tmp/pear/temp/yaml/yaml.c:35:0:
/tmp/pear/temp/yaml/php_yaml.h:56:10: fatal error: ext/standard/php_smart_str.h: No such file or directory
#include <ext/standard/php_smart_str.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**compilation terminated.
Makefile:193: recipe for target 'yaml.lo' failed
make: *** [yaml.lo] Error 1
ERROR: `make' failed**
Notes:
OS: Ubuntu 18
php5.6 -i | grep yaml
/etc/php/5.6/cli/conf.d/20-yaml.ini,
yaml
yaml.decode_binary => 0 => 0
yaml.decode_php => 1 => 1
yaml.decode_timestamp => 0 => 0
yaml.output_canonical => 0 => 0
yaml.output_indent => 2 => 2
yaml.output_width => 80 => 80
This issue resolved after removing all php versions and keep one version which is needed (PHP 5.6)
So that, I think to resolve issue you need to enable specific php ver, and disable others and usually all will work fine...
Also you need to make sure thats if you install yaml(v2.0+) for php 7+, you need to remove it and then install yaml-1.3.1 which its support php 5.
Note: make sure you are installe phpX.Y-xml.
I have recently switched PHP versions in MAMP PRO from PHP 7.1.19 to PHP 7.2.20. I currently use Symfony 3.4. However Symfony now keeps complaining about my memcache extension missing:
I have read that this could be due to memcache not being supported in 7.2 any longer? I have already tried numerous ways to install memcache for PHP 7.2 with no luck.
pecl install memcache
However the installation fails and ends with the following line (fatal error: 'zend_config.h' file not found):
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-rootw4LXAq/memcache-2.2.7/libtool --mode=compile cc -I/Applications/MAMP/bin/php/php7.2.20/include/php -I. -I/private/tmp/pear/temp/memcache -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootw4LXAq/memcache-2.2.7/include -I/private/tmp/pear/temp/pear-build-rootw4LXAq/memcache-2.2.7/main -I/private/tmp/pear/temp/memcache -I/Applications/MAMP/bin/php/php7.2.20/include/php -I/Applications/MAMP/bin/php/php7.2.20/include/php/main -I/Applications/MAMP/bin/php/php7.2.20/include/php/TSRM -I/Applications/MAMP/bin/php/php7.2.20/include/php/Zend -I/Applications/MAMP/bin/php/php7.2.20/include/php/ext -I/Applications/MAMP/bin/php/php7.2.20/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/memcache/memcache.c -o memcache.lo
mkdir .libs
cc -I/Applications/MAMP/bin/php/php7.2.20/include/php -I. -I/private/tmp/pear/temp/memcache -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootw4LXAq/memcache-2.2.7/include -I/private/tmp/pear/temp/pear-build-rootw4LXAq/memcache-2.2.7/main -I/private/tmp/pear/temp/memcache -I/Applications/MAMP/bin/php/php7.2.20/include/php -I/Applications/MAMP/bin/php/php7.2.20/include/php/main -I/Applications/MAMP/bin/php/php7.2.20/include/php/TSRM -I/Applications/MAMP/bin/php/php7.2.20/include/php/Zend -I/Applications/MAMP/bin/php/php7.2.20/include/php/ext -I/Applications/MAMP/bin/php/php7.2.20/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/memcache/memcache.c -fno-common -DPIC -o .libs/memcache.o
In file included from /private/tmp/pear/temp/memcache/memcache.c:26:
In file included from /Applications/MAMP/bin/php/php7.2.20/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.2.20/include/php/Zend/zend.h:29:
In file included from /Applications/MAMP/bin/php/php7.2.20/include/php/Zend/zend_types.h:27:
/Applications/MAMP/bin/php/php7.2.20/include/php/Zend/zend_portability.h:45:11: fatal error: 'zend_config.h' file not found
I've also tried adding memcache.so to php.ini. But I'm not sure where to get the correct memcache.so file for PHP7.2
I've added extension=memcache.so to my php.ini file in MAMP PRO > File > Edit Template > 7.2.20
Note that this error concerns memcache and not memcached. I haven't found any solutions on StackOverflow concerning my memcache error.
I have a problem with building WSO2 WSF/PHP on my FreeBSD 8.1. It seems that something broken in the source.
I check all prerequisites then run ./configure && make and receive next error:
Making all in platforms/unix
/usr/local/bin/bash ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fPIC -DPIC -o .libs/uuid_gen_unix.o
uuid_gen_unix.c: In function 'axutil_uuid_get_mac_addr':
uuid_gen_unix.c:332: error: 'SIOCGARP' undeclared (first use in this function)
After googling I found an advice to configure with ./configure 'CPPFLAGS=-DHAVE_GETIFADDRS'. After that make command almost finished but die at the end with following information:
gcc -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -o .libs/test test.o ../../axiom/src/om/.libs/libaxis2_axiom.so ../../util/src/.libs/libaxutil.so ../src/.libs/libneethi.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/om/.libs/libaxis2_axiom.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/parser/guththila/.libs/libaxis2_parser.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/guththila/src/.libs/libguththila.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src/.libs/libaxutil.so -lpthread -lz -Wl,--rpath -Wl,/usr/local/wsf_c/lib
../../util/src/.libs/libaxutil.so: undefined reference to `ftime'
What should I do to completely build WSO2 on my FreeBSD?
UPD1
Building after ./configure 'CPPFLAGS=-DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat'
gcc -shared -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive -lcompat -lpthread -lz -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value
UPD2
Building after ./configure CPPFLAGS='-fPIC -DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat'
gcc -shared .libs/hash.o .libs/allocator.o .libs/env.o .libs/error.o .libs/stream.o .libs/log.o .libs/string.o .libs/string_util.o .libs/qname.o .libs/array_list.o .libs/linked_list.o .libs/utils.o .libs/dir_handler.o .libs/file_handler.o .libs/class_loader.o .libs/network_handler.o .libs/file.o .libs/uuid_gen.o .libs/thread_pool.o .libs/property.o .libs/types.o .libs/param.o .libs/param_container.o .libs/dll_desc.o .libs/url.o .libs/stack.o .libs/generic_obj.o .libs/base64.o .libs/uri.o .libs/date_time.o .libs/base64_binary.o .libs/properties.o .libs/http_chunked_stream.o .libs/rand.o .libs/date_time_util.o .libs/version.o .libs/duration.o .libs/frame.o .libs/stomp.o .libs/md5.o .libs/digest_calc.o -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive -lcompat -lpthread -lz -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value
*** Error code 1
Stop in /usr/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src.
./configure 'CPPFLAGS=-DHAVE_GETIFADDRS LDFLAGS==-lcompat'
I am also trying to run WSO2 on various FreeBSD AMD64 without success.
I am compiling WSO2 in jail built on top of ezjail.
Since recompilation of libcompat is required I did it in "main" system. All the rest is done in the jail.
In main system (without jail) I recompiled libcompat (/usr/src/lib/libcompat) with -fPIC in makefile, so now the line looks like that:
CFLAGS+=-fPIC -DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale
[root#system /usr/src/lib/libcompat]# make install
install -C -o root -g wheel -m 444 libcompat.a /usr/lib
install -C -o root -g wheel -m 444 libcompat_p.a /usr/lib
Then
I copied libcompat.a and libcompat_p.a into basejail and switched to jail where I made a compilation
I found this: http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/
which inspired me.
I modified wsf_c/axis2c/util/src/platforms/unix/uuid_gen_unix.c and added
#include < sys/param.h>
(I put ^^^^ space here because I it was wrongly parsed by stackoverflow portal)
3 . Then I modified configure.m4 and I put the following path
PHP_ADD_INCLUDE(/usr/local/include/libxml2/libxml) replacing the original one
4 . Then still having problems with compilation I added these environment variables
export CPATH=/usr/local/include:/usr/local/include/libxml2:/usr/local/ssl/include/openssl::/usr/local/ssl/include
export LD_LIBRARY_PATH=/usr/local/lib
5 . And finally I managed to compile without errors
./configure "CPPFLAGS=-fPIC -DHAVE_GETIFADDRS" "LDFLAGS=-lcompat"
make
make install
My test jail on remote server doesnt have the web interface available yet and thus I couldn't test this installation on samples provided, but I am pretty sure that I would succeed since there were no errors during make nor during make install.
Php -m shows wsf module without any segfaults.
Samples are also working fine. I can't get wsdls yet, but it is rather matter of time.
The important problem you may face is openssl. It must be in ver 0.9.8 at least if I recall correctly. I am using 1.x. though
Although this setup is working fine on Freebsd 8.x I was unable to have it working on FreeBSD 6.x. On 6.x I finally built WSO2 successfully, but got segfaults when included wsf.so in php configuration ... then I gave up on 6.x and focused on freebsd 8.x where it seems to work fine ... just starting to do some programming with this module.
I have been trying to compile geos on my restrcited(no 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 Im getting 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 too
This happens because GEOS requires PHP header files from the original PHP source, and MAMP does not include those.
EDIT 1:
I have also added this in ~/local/share/config.site
CPPFLAGS=-I./opt/alt/php53/usr/include/
LDFLAGS=-L$HOME/local/lib
php.h is located 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 thing: my ./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 for solving this, is how do I include my php header files while compiling geos in a non root evnironment in centOs ?
Im quite lost to be honest !
I'm fairly certain the path to your PHP installation does not start with a . - not from inside the geos-3.4.2 folder anyway, and certainly not from inside an arbitrary source folder.
You should make that path absolute.
I'm assuming the opt folder is in your user folder, so the full path would be $HOME/opt/alt/php53/usr/. Thanks for the clarification, the full path should then be /opt/alt/php53/usr/.
You need to add the bin folder to your PATH variable, the include folder to CPPFLAGS and the lib folder to LDFLAGS.
With $HOME/local/ this is not necessary, since that is the PREFIX, and will be added automatically.
Also note that when adding stuff to your PATH variable, you should add it to the beginning instead of the end, so that it will take precedence over system binaries.
I also suggest you undo the changes you made to ~/local/share/config.site (or remove the file, if it didn't exist), as options there will affect all automake-based projects.
You should rather pass CPPFLAGS and LDFLAGS as arguments to configure.
After all that, your command block should look something like:
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