SHORT STORY
PHP seems to work, simple "hello world" inside PHP brackets works.
However, other functions fail.
Even 'phpinfo()' fails with Fatal error: Call to undefined function phpinfo() in ...
LONG STORY
I'm trying to compile and install PHP manually, on a machine that I don't have root access to. I've been following this script: https://github.com/minghuascode/UserLAMP
I had to make some tweaks to it, but Apache Server seems to run successfully and serves simple HTML files.
PHP had many problems in compilation, some warnings regarding gawk, and errors in PHAR and PEAR. I've tried several versions: 5.2.17, 5.3.22, 5.4.12 and finally php5.3-201303060830
The only way that compile finishes without errors is with these flags:
./configure --prefix=$(SERVERS)/$(DSTPHPDIR) \
--with-mysql=$(SERVERS)/$(DSTMYSQLDIR) \
--with-pdo-mysql=$(SERVERS)/$(DSTMYSQLDIR) \
--with-apxs2=$(SERVERS)/$(DSTAPACHEDIR)/bin/apxs \
--disable-phar \
--without-pear \
However, it fails even to execute phpinfo()
Please advice.
Thanks :)
EDIT
When I tried to run php -i
I've found that there is already an old version PHP in my system, installed by the administrators. Maybe that's causing a conflict?
$ php -ver
PHP 4.3.8 (cli) (built: Aug 9 2004 14:33:18)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
$ ./php -ver
PHP 5.3.24-dev (cli) (built: Mar 6 2013 10:50:33)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
2nd EDIT
This might be helpful:
$ ./php -m
[PHP Modules]
Core
[Zend Modules]
$ ./php --rf phpinfo
Segmentation fault