Talk:How to set up PHP under AOLserver
I've downloaded the aolserver src both directly and via the Debian source package, but cannot get php-5.1.1 to build:
sam@caveman:~/downloads/php.net/php-5.1.1$ ./configure --with-aolserver --with-aolserver-src=/home/sam/downloads/aolserver.org/aolserver-4.0.10 aolserver-4.0.10 aolserver-4.0.10-src.tar.gz sam@caveman:~/downloads/php.net/php-5.1.1$ ./configure --with-aolserver --with-aolserver-src=/home/sam/downloads/aolserver.org/aolserver-4.0.10 --enable-shared loading cache ./config.cache checking for Cygwin environment... no checking for mingw32 environment... no checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking whether gcc and cc understand -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for AIX... no checking whether ln -s works... yes checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking for re2c... re2c checking for re2c version... invalid configure: warning: You will need re2c 0.98 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking for bison... bison -y checking for bison version... 1.875 (ok) checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for working const... yes checking for flex version... invalid configure: warning: flex versions supported for regeneration of the Zend/PHP parsers: 2.5.4 (found: 2.5.31). checking whether to force non-PIC code in shared modules... yes checking for pthreads_cflags... -pthread checking for pthreads_lib... Configuring SAPI modules checking for AOLserver support... yes configure: error: Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR sam@caveman:~/downloads/php.net/php-5.1.1$
sam@caveman:~/downloads/php.net/php-5.1.1$ ls /home/sam/downloads/aolserver.org/aolserver-4.0.10 ChangeLog configure index.html nscgi nsext nssock tcl Makefile configure.in ini2tcl.tcl nscp nslog nsssl tcl2ini.tcl README doc install-sh nsd nspd nsthread tests aclocal.m4 include license.terms nsdb nsperm sample-config.tcl win32 sam@caveman:~/downloads/php.net/php-5.1.1$
Perhaps I am simply an idiot (would not be the first time) but something "no longer works".
- I only ever tested this against PHP 4.3.7 -- I don't know what is required to make it work with PHP 5.1.1. If you figure it out, please update the page. -- Dossy 12:05, 7 December 2005 (EST)
- This may be an issue more with the way Debian 3.1 installs AOLServer 4 than anything else. The "proper" PHP configure command should be:
./configure --with-aolserver=/path/to/installed/aolserver
Debian 3.1 configures AOLServer with a prefix of "/usr/lib/aolserver4". However, using this as the "/path/to/installed/aolserver" results in the same error and a request for "--with-aolserver-src".
- I configured and installed aolserver4 from source into "/home/sam/aolserver". PHP configure finally completed successfully. However, PHP compile still failed:
/bin/sh /home/sam/downloads/php.net/php-5.1.1/libtool --silent --preserve-dup-deps --mode=compile /home/sam/downloads/php.net/php-5.1.1/meta_ccld -Isapi/aolserver/ -I/home/sam/downloads/php.net/php-5.1.1/sapi/aolserver/ -DPHP_ATOM_INC -I/home/sam/downloads/php.net/php-5.1.1/include -I/home/sam/downloads/php.net/php-5.1.1/main -I/home/sam/downloads/php.net/php-5.1.1 -I/home/sam/aolserver/include -I/usr/include/libxml2 -I/home/sam/downloads/php.net/php-5.1.1/ext/date/lib -I/home/sam/downloads/php.net/php-5.1.1/TSRM -I/home/sam/downloads/php.net/php-5.1.1/Zend -D_REENTRANT -g -O2 -pthread -DZTS -prefer-non-pic -c /home/sam/downloads/php.net/php-5.1.1/sapi/aolserver/aolserver.c -o sapi/aolserver/aolserver.lo In file included from /home/sam/aolserver/include/ns.h:62, from /home/sam/downloads/php.net/php-5.1.1/sapi/aolserver/aolserver.c:49: /home/sam/aolserver/include/nsthread.h:125:17: tcl.h: No such file or directory
This was obviously an error finding "tcl.h". I manually edited the PHP "Makefile" and set:
EXTRA_INCLUDES = -I/usr/include/tcl8.4
This allowed PHP compilation to complete. The module loaded successfully and PHP scripts work as expected (see phpinfo output). --Caveman 19:05, 8 December 2005 (EST)
With trial and error, I was able to configure and compile against the Debian 3.1 packages as installed by default:
./configure --with-aolserver=/usr make "EXTRA_INCLUDES=-I/usr/include/tcl8.4 -I/usr/include/aolserver4"
extending PHP to take advantage of AOLServer
http://aolserver.org/docs/devel/c/api/c-ch3.htm#37064
proposal: write a PHP extension to provide PHP functions to access AOLServer database pools (and perhaps other important features like shared memory).
In other words, provide PHP functions:
ns_db_gethandle ns_db_select
And so on. It should be nearly trivial to do this, and give PHP on AOLServer a very powerful advantage over PHP on Apache.