Subject: Apache 2 and PHP4 modules
To: None <>
From: Quentin Garnier <>
List: tech-pkg
Date: 11/02/2002 17:54:42
PHP4 needs experimental code to be compiled as a DSO module for Apache2.
It's not obvious, since it's activated automatically when --with-apxs2 is

Therefore, the packages php4 and ap2-php4 are different enough not to
allow load extensions compiled against the php4. The problem
appears as complaining about an unknown symbol
(executator_globals), but even if it's a bug of PHP, I doubt an extension
using regular code could work with's experimental code.

That experimental code needs POSIX threads (ap2-php4 uses pth), this is
the reason for the dependency.

I managed to have php4-mysql and php4-imap work with Apache 2, my guess is
that all the others should work too.

The following patch is what I had to do, but it's not useable : php4
should include experimental code _only_ to support Apache 2. Since I don't
know how to do that, I preferred asking here before sending a PR.

Note that I also had to make php4-mysql use buildlink2 for the
mysql-client dependency.


--- pkgsrc/www/php4/Makefile.common.orig        Mon Oct 14 08:21:18 2002
+++ pkgsrc/www/php4/Makefile.common     Sat Nov  2 16:11:49 2002
@@ -30,4 +30,10 @@
 PKG_SYSCONFVAR?=       php
+CONFIGURE_ARGS+=       --enable-experimental-zts
+CONFIGURE_ARGS+=       --with-tsrm-pth
 .include "../../mk/"
+.include "../../devel/pth/"

--- pkgsrc/databases/php4-mysql/Makefile.orig   Thu Feb 28 07:17:09 2002
+++ pkgsrc/databases/php4-mysql/Makefile        Sat Nov  2 16:27:34 2002
@@ -5,7 +5,7 @@
 PKGREVISION=           # empty
 COMMENT=               PHP4 extension for MySQL databases
-DEPENDS+=              mysql-client>=3.23.35:../../databases/mysql-client
+#DEPENDS+=             mysql-client>=3.23.35:../../databases/mysql-client
 .include "../../www/php4/Makefile.module"
@@ -13,4 +13,5 @@
 CONFIGURE_ARGS+=       --with-${MODNAME}=shared,${MYSQLDIR}
 LDFLAGS+=              -Wl,-R${LOCALBASE}/lib/mysql
+.include "../../databases/mysql-client/"
 .include "../../mk/"

That's how I did it, Anton. I never saved anything
for the swim back.
Vincent/Jerome, in Gattaca.