<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jahbini</id>
	<title>AOLserver Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jahbini"/>
	<link rel="alternate" type="text/html" href="https://panoptic.com/wiki/aolserver/Special:Contributions/Jahbini"/>
	<updated>2026-04-17T09:39:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Talk:How_to_set_up_PHP_under_AOLserver&amp;diff=4982</id>
		<title>Talk:How to set up PHP under AOLserver</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Talk:How_to_set_up_PHP_under_AOLserver&amp;diff=4982"/>
		<updated>2006-10-17T17:43:22Z</updated>

		<summary type="html">&lt;p&gt;Jahbini: Getting PHP and AOLserver to work on Mac OS X&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I cannot get php-5.1.1 to build with Debian 3.1 package of aolserver4 and aolserver4-dev (which is built with --prefix=/usr/lib/aolserver4):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sam@caveman:~/downloads/php.net/php-5.1.1$ ./configure --with-aolserver=/usr/lib/aolserver4&lt;br /&gt;
loading cache ./config.cache&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
Configuring SAPI modules&lt;br /&gt;
checking for AOLserver support... /usr/lib/aolserver4&lt;br /&gt;
configure: error: Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR&lt;br /&gt;
sam@caveman:~/downloads/php.net/php-5.1.1$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''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.  -- [[User:Dossy|Dossy]] 12:05, 7 December 2005 (EST)''&lt;br /&gt;
&lt;br /&gt;
** I opened a PHP bug issue for this: [http://bugs.php.net/bug.php?id=35605] --[[User:Caveman|Caveman]] 14:05, 8 December 2005 (EST)&lt;br /&gt;
&lt;br /&gt;
*** This may be an issue more with the way Debian 3.1 installs AOLserver 4 than anything else. The &amp;quot;proper&amp;quot; PHP configure command should be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --with-aolserver=/path/to/installed/aolserver&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Debian 3.1 configures AOLServer with a prefix of &amp;quot;/usr/lib/aolserver4&amp;quot;. However, using this as the &amp;quot;/path/to/installed/aolserver&amp;quot; results in the same error and a request for &amp;quot;--with-aolserver-src&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
**** I configured and installed aolserver4 from source into &amp;quot;/home/sam/aolserver&amp;quot;. PHP configure finally completed successfully. However, PHP compile still failed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/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&lt;br /&gt;
In file included from /home/sam/aolserver/include/ns.h:62,&lt;br /&gt;
                 from /home/sam/downloads/php.net/php-5.1.1/sapi/aolserver/aolserver.c:49:&lt;br /&gt;
/home/sam/aolserver/include/nsthread.h:125:17: tcl.h: No such file or directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was obviously an error finding &amp;quot;tcl.h&amp;quot;. I manually edited the PHP &amp;quot;Makefile&amp;quot; and set:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EXTRA_INCLUDES = -I/usr/include/tcl8.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allowed PHP compilation to complete. The module loaded successfully and PHP scripts work as expected (see [http://caveman.org/phpinfo/ phpinfo output]). --[[User:Caveman|Caveman]] 19:05, 8 December 2005 (EST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
With trial and error, I was able to configure and compile against the Debian 3.1 packages as installed by default:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --with-aolserver=/usr&lt;br /&gt;
make &amp;quot;EXTRA_INCLUDES=-I/usr/include/tcl8.4 -I/usr/include/aolserver4&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I was able to get php 5.1.2 to make with the above (after satisfying all the dependencies, first), no patching necessary. --mcginniwa 8 April 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== extending PHP to take advantage of AOLServer ==&lt;br /&gt;
&lt;br /&gt;
http://aolserver.org/docs/devel/c/api/c-ch3.htm#37064&lt;br /&gt;
&lt;br /&gt;
proposal: write a PHP extension to provide PHP functions to access AOLserver database pools (and perhaps other important features like shared memory).&lt;br /&gt;
&lt;br /&gt;
In other words, provide PHP functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ns_db_gethandle&lt;br /&gt;
ns_db_select&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And so on. It should be nearly trivial to do this, and give PHP on AOLserver a very powerful advantage over PHP on Apache.&lt;br /&gt;
&lt;br /&gt;
[http://www.webtechniques.com/archives/2001/01/junk/ Extending PHP By Sterling Hughes]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sam@caveman:~/downloads/php.net/php-5.1.1/ext$ ./ext_skel --extname=nsdb&lt;br /&gt;
Creating directory nsdb&lt;br /&gt;
Creating basic files: config.m4 config.w32 .cvsignore nsdb.c php_nsdb.h CREDITS EXPERIMENTAL tests/001.phpt nsdb.php [done].&lt;br /&gt;
&lt;br /&gt;
To use your new extension, you will have to execute the following steps:&lt;br /&gt;
&lt;br /&gt;
1.  $ cd ..&lt;br /&gt;
2.  $ vi ext/nsdb/config.m4&lt;br /&gt;
3.  $ ./buildconf&lt;br /&gt;
4.  $ ./configure --[with|enable]-nsdb&lt;br /&gt;
5.  $ make&lt;br /&gt;
6.  $ ./php -f ext/nsdb/nsdb.php&lt;br /&gt;
7.  $ vi ext/nsdb/nsdb.c&lt;br /&gt;
8.  $ make&lt;br /&gt;
&lt;br /&gt;
Repeat steps 3-6 until you are satisfied with ext/nsdb/config.m4 and&lt;br /&gt;
step 6 confirms that your module is compiled into PHP. Then, start writing&lt;br /&gt;
code and repeat the last two steps as often as necessary.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting PHP and AOLserver to work on Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
The hacks to get PHP and AOLserver dont work on the Mac due to its &amp;quot;interesting&amp;quot; linking requirements.  It took me several days of headscratching and worse to get everything linked and working.&lt;br /&gt;
&lt;br /&gt;
Here are some things you want to be aware of if you intend to do this.&lt;br /&gt;
* If you &amp;quot;accidently&amp;quot; put AOLserver in /usr or /usr/local and then decide to install it elsewhere, you must remove any dylibs that get installed in /usr/lib or /usr/local/lib.  The link steps will try those locations and pick up any obsolete builds rather than your new builds.&lt;br /&gt;
* Look closely at the config.m4 scripts in &amp;quot;sapi/apache.&amp;quot;  for PHP4 or PHP5.  They do link on the Mac:  They have the secret sauce.&lt;br /&gt;
* use the attached shell script to install PHP4 or PHP5 on AOLserver (or naviserver).  Yes, I did test it with all 4 combinations on my system.  Will it work on your system?  I never guarantee anything.  Not even death or taxes.&lt;br /&gt;
* The script depends on the buildconf being present.  It also depends on the PHP4 or PHP5 directory structure.&lt;br /&gt;
* if your are doing this for naviserver, you will need to get the optional sapi/naviserver directory from the naviserver guys.&lt;br /&gt;
* make sure you edit the lines that &lt;br /&gt;
**select the destination and source directories for aolserver or naviserver&lt;br /&gt;
**select the version of php (php4 or php5)&lt;br /&gt;
** set the c source file name (nsphp.c for naviserver or aolserver.c for AOLserver)&lt;br /&gt;
* pre-build any ancillary php support (ming, mysql, etc) and put in the BUILDDEST&lt;br /&gt;
* execute the script in the php source top level directory (where you normally would run ./configure)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# build php4 or php5 to run under naviserver or aolserver on OX X&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# set bash to super caffeinated mode for lots of talky-talky debug stuff&lt;br /&gt;
#set -v&lt;br /&gt;
#set -x&lt;br /&gt;
&lt;br /&gt;
#server is naviserver or aolserver -- this script (mostly) works for either: note that the only file that needs to be &amp;quot;fixed&amp;quot;&lt;br /&gt;
#is the sapi/server/config.m4&lt;br /&gt;
#  We do that here and really ONLY for MAC OSX -- My interests are quite limited.  Be advised.&lt;br /&gt;
#server=Naviserver&lt;br /&gt;
#c_source=nsphp.c&lt;br /&gt;
server=AOLserver&lt;br /&gt;
c_source=aolserver.c&lt;br /&gt;
&lt;br /&gt;
#this is where your pre-built libs for mysql, ming, etc are hanging out:  They will need include and lib directories under BUILDDEST&lt;br /&gt;
BUILDDEST=$HOME/development/builds&lt;br /&gt;
&lt;br /&gt;
#this is where your server will be when you run it.&lt;br /&gt;
DEST=$HOME/$server&lt;br /&gt;
serverLOWC=`echo $server| tr [:upper:] [:lower:]`&lt;br /&gt;
serverCAPS=`echo $server| tr [:lower:] [:upper:]`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OTHERSCONFIG=&amp;quot;--with-mysql=$BUILDDEST --with-zlib=/usr --with-ming=$BUILDDEST --with-gd=$BUILDDEST --with-gdm=$BUILDDEST --with-pcre=$BUILDDEST --with-pdf=$BUILDDEST --with-ming=$BUILDDEST&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#phpversion is php4 or php5&lt;br /&gt;
phpkind=php4&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt;sapi/$serverLOWC/config.m4  &amp;lt;&amp;lt;ENDCONFIG&lt;br /&gt;
dnl&lt;br /&gt;
dnl \$Id: config.m4,v 1.15 2002/03/07 14:19:47 sas Exp $&lt;br /&gt;
dnl&lt;br /&gt;
&lt;br /&gt;
RESULT=no&lt;br /&gt;
AC_MSG_CHECKING(for $server support)&lt;br /&gt;
AC_ARG_WITH($serverLOWC,&lt;br /&gt;
[  --with-$serverLOWC=DIR    Specify path to the installed ${serverCAPS}],[&lt;br /&gt;
  PHP_$serverCAPS=\$withval&lt;br /&gt;
],[&lt;br /&gt;
  PHP_$serverCAPS=no&lt;br /&gt;
])&lt;br /&gt;
AC_MSG_RESULT(\$PHP_${serverCAPS})&lt;br /&gt;
&lt;br /&gt;
if test &amp;quot;\$PHP_${serverCAPS}&amp;quot; != &amp;quot;no&amp;quot;; then&lt;br /&gt;
  if test -d &amp;quot;\$PHP_${serverCAPS}/include&amp;quot;; then&lt;br /&gt;
    PHP_${serverCAPS}_SRC=\$PHP_${serverCAPS}&lt;br /&gt;
  fi&lt;br /&gt;
  if test -z &amp;quot;\$PHP_${serverCAPS}_SRC&amp;quot; || test ! -d \$PHP_${serverCAPS}_SRC/include; then&lt;br /&gt;
    AC_MSG_ERROR(Please specify the path to the source distribution of ${server} using --with-${serverLOWC}-src=DIR)&lt;br /&gt;
  fi&lt;br /&gt;
  if test ! -d \$PHP_${serverCAPS}/bin ; then&lt;br /&gt;
    AC_MSG_ERROR(Please specify the path to the root of ${server} using --with-${serverLOWC}=DIR)&lt;br /&gt;
  fi&lt;br /&gt;
  PHP_BUILD_THREAD_SAFE&lt;br /&gt;
  AC_DEFINE(WITH_${serverCAPS},1,[Whether you want ${server} support])&lt;br /&gt;
  AC_DEFINE(HAVE_${serverCAPS},1,[Whether you have ${server}])&lt;br /&gt;
  PHP_ADD_INCLUDE(\$PHP_${serverCAPS}_SRC/include)&lt;br /&gt;
  case \$host_alias in&lt;br /&gt;
  *darwin*)&lt;br /&gt;
    MH_BUNDLE_FLAGS=&amp;quot;-dynamic -twolevel_namespace -bundle -bundle_loader \\\$(INSTALL_ROOT)\$PHP_${serverCAPS}/bin/nsd&amp;quot;&lt;br /&gt;
    PHP_SUBST(MH_BUNDLE_FLAGS)&lt;br /&gt;
	PHP_FRAMEWORKS=&amp;quot;-framework Tcl -framework CoreFoundation&amp;quot;&lt;br /&gt;
	EXTRA_LIBS=&amp;quot;\$EXTRA_LIBS -L\$PHP_${serverCAPS}/lib -lnsd -lnsthread&amp;quot;&lt;br /&gt;
    SAPI_SHARED=libs/lib${phpkind}.so&lt;br /&gt;
    build_type=bundle&lt;br /&gt;
    ;;&lt;br /&gt;
  *)&lt;br /&gt;
    build_type=shared&lt;br /&gt;
    ;;&lt;br /&gt;
  esac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  PHP_SELECT_SAPI($serverLOWC, \$build_type, $c_source)&lt;br /&gt;
  INSTALL_IT=&amp;quot;\\\$(INSTALL) -m 0755 \$SAPI_SHARED \\\$(INSTALL_ROOT)\$PHP_${serverCAPS}/bin/&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
dnl ## Local Variables:&lt;br /&gt;
dnl ## tab-width: 4&lt;br /&gt;
dnl ## End:&lt;br /&gt;
&lt;br /&gt;
ENDCONFIG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rm -f autom4te.cache/*&lt;br /&gt;
./buildconf --force&lt;br /&gt;
make clean&lt;br /&gt;
./configure --with-$serverLOWC=$DEST  --prefix=$BUILDDEST $OTHERSCONFIG&lt;br /&gt;
make&lt;br /&gt;
cp libs/lib${phpkind}.so $DEST/bin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jahbini</name></author>
		
	</entry>
</feed>