Hello,
Did anyone try to build a port for a FastCGI-enabled version of PHP? It makes a lot of sense since we already have fcgi, mod_fastcgi and
lighttpd that can't get proper PHP support without fastcgi.

 Here's a start, that seems to work fine with lighttpd.
diff -urN www/php5.old/Makefile www/php5/Makefile
--- www/php5.old/Makefile       Sat Oct  2 13:32:35 2004
+++ www/php5/Makefile   Wed Feb  1 16:09:32 2006
@@ -1,6 +1,7 @@
 # $OpenBSD: Makefile,v 1.1.1.1 2004/10/02 11:32:35 robert Exp $
 
 SUBDIR += core
+SUBDIR += fastcgi
 SUBDIR += extensions
 SUBDIR += extensions,no_x11
 
diff -urN www/php5.old/fastcgi/Makefile www/php5/fastcgi/Makefile
--- www/php5.old/fastcgi/Makefile       Thu Jan  1 01:00:00 1970
+++ www/php5/fastcgi/Makefile   Wed Feb  1 17:16:45 2006
@@ -0,0 +1,56 @@
+# $OpenBSD$
+
+COMMENT=       "server-side HTML-embedded scripting language, fastcgi version"
+PKGNAME=       php5-fastcgi-${V}
+
+CONFIGURE_ARGS+= --enable-fastcgi \
+               --enable-force-cgi-redirect \
+               --without-mysql \
+               --enable-xml \
+               --enable-wddx \
+               --with-iconv=${LOCALBASE} \
+               --with-gettext=${LOCALBASE} \
+               --enable-dio \
+               --with-pear=${PEAR_DIR} \
+               --enable-bcmath \
+               --enable-session \
+               --enable-trans-sid \
+               --enable-calendar \
+               --enable-ctype \
+               --enable-ftp \
+               --with-pcre-regex \
+               --with-posix \
+               --enable-sockets \
+               --enable-sysvsem \
+               --enable-sysvshm \
+               --enable-yp \
+               --enable-exif \
+               --without-sqlite
+
+MODULES=       devel/gettext
+
+# some variables to substitute
+SUBST_VARS=    PHP_CONFIG_FILE
+PHP_VERSION=   ${V}
+
+.for i in TRUEPREFIX PHP_CONFIG_FILE MODULES_DIR PHP_VERSION
+PHPXS_SUBST+= -e 's,${i},${${i}},'
+.endfor
+
+WANTLIB=       c crypto des m ssl stdc++ z
+
+LIB_DEPENDS=   xml2.8::textproc/libxml
+RUN_DEPENDS=   :php5-core-${V}:www/php5/core
+
+INSTALL_TARGET=
+FAKE_FLAGS=    INSTALL_ROOT=${DESTDIR}
+
+post-patch:
+       @perl -p -i.orig -e "s,OPENBSD_PEAR_ROOT,'${CHROOT_DIR}/pear',g" \
+               ${WRKSRC}/pear/PEAR/Config.php ${WRKSRC}/scripts/phpize.in \
+               ${WRKSRC}/scripts/php-config.in
+
+post-install:
+       ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cgi/php ${PREFIX}/bin/php-fcgi
+
+.include <bsd.port.mk>
diff -urN www/php5.old/fastcgi/patches/patch-ext_yp_yp_c 
www/php5/fastcgi/patches/patch-ext_yp_yp_c
--- www/php5.old/fastcgi/patches/patch-ext_yp_yp_c      Thu Jan  1 01:00:00 1970
+++ www/php5/fastcgi/patches/patch-ext_yp_yp_c  Wed Feb  1 16:09:17 2006
@@ -0,0 +1,21 @@
+$OpenBSD: patch-ext_yp_yp_c,v 1.3 2005/12/29 23:06:28 sturm Exp $
+--- ext/yp/yp.c.orig   Mon Jul 26 22:49:33 2004
++++ ext/yp/yp.c        Mon Jul 26 22:51:22 2004
+@@ -280,7 +280,7 @@
+       convert_to_string_ex(domain);
+       convert_to_string_ex(map);
+ 
+-      callback.foreach = php_foreach_all;
++      (char *) callback.foreach = php_foreach_all;
+       callback.data = (char *) php_callback;
+ 
+       yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback);
+@@ -337,7 +337,7 @@
+ 
+       array_init(return_value);
+ 
+-      callback.foreach = php_foreach_cat;
++      (char *) callback.foreach = php_foreach_cat;
+       callback.data = (char *) return_value;
+ 
+       yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback);
diff -urN www/php5.old/fastcgi/patches/patch-scripts_Makefile_frag 
www/php5/fastcgi/patches/patch-scripts_Makefile_frag
--- www/php5.old/fastcgi/patches/patch-scripts_Makefile_frag    Thu Jan  1 
01:00:00 1970
+++ www/php5/fastcgi/patches/patch-scripts_Makefile_frag        Wed Feb  1 
16:09:17 2006
@@ -0,0 +1,14 @@
+$OpenBSD: patch-scripts_Makefile_frag,v 1.2 2005/09/14 15:44:19 robert Exp $
+--- scripts/Makefile.frag.orig Tue Jun  7 23:57:06 2005
++++ scripts/Makefile.frag      Wed Sep 14 16:48:56 2005
+@@ -3,8 +3,8 @@
+ # Build environment install
+ #
+ 
+-phpincludedir = $(includedir)/php
+-phpbuilddir = $(libdir)/build
++phpincludedir = $(peardir)/include
++phpbuilddir = $(peardir)/build
+ 
+ BUILD_FILES = \
+       scripts/phpize.m4 \
diff -urN www/php5.old/fastcgi/pkg/DESCR www/php5/fastcgi/pkg/DESCR
--- www/php5.old/fastcgi/pkg/DESCR      Thu Jan  1 01:00:00 1970
+++ www/php5/fastcgi/pkg/DESCR  Wed Feb  1 17:39:34 2006
@@ -0,0 +1,2 @@
+This package installs a special version of PHP called php5-fcgi, suitable for
+use with any fastcgi server like www/fcgi and www/lighttpd.
diff -urN www/php5.old/fastcgi/pkg/PLIST www/php5/fastcgi/pkg/PLIST
--- www/php5.old/fastcgi/pkg/PLIST      Thu Jan  1 01:00:00 1970
+++ www/php5/fastcgi/pkg/PLIST  Wed Feb  1 17:16:26 2006
@@ -0,0 +1,2 @@
[EMAIL PROTECTED] $OpenBSD$
+bin/php-fcgi

Reply via email to