diff -urN php-4.3.7.orig/configure.in php-4.3.7/configure.in
--- php-4.3.7.orig/configure.in	2004-06-02 09:25:44.000000000 -0400
+++ php-4.3.7/configure.in	2004-06-08 02:22:28.000000000 -0400
@@ -996,12 +996,12 @@
 
 case $libdir in
   '${exec_prefix}/lib')
-    libdir=$libdir/php
+    libdir=$libdir/php4
     ;;
 esac
 case $datadir in
   '${prefix}/share')
-    datadir=$datadir/php
+    datadir=$datadir/php4
     ;;
   *) ;;
 esac
@@ -1058,7 +1058,7 @@
 EXPANDED_DATADIR=$datadir
 EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
 EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
-INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
+INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:/usr/share/pear
 
 exec_prefix=$old_exec_prefix
 libdir=$old_libdir
diff -urN php-4.3.7.orig/sapi/caudium/config.m4 php-4.3.7/sapi/caudium/config.m4
--- php-4.3.7.orig/sapi/caudium/config.m4	2003-10-03 01:25:45.000000000 -0400
+++ php-4.3.7/sapi/caudium/config.m4	2004-06-08 02:22:28.000000000 -0400
@@ -25,8 +25,8 @@
 		AC_MSG_ERROR(Couldn't find a pike in $withval/bin/)
 	fi
     if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0268) exit(1); exit(0);'; then
-		PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'`
-	    PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,' `
+		PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Master file' | sed -e 's/.*: //' -e 's/master.pike/modules/'`
+	    PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/modules,,' -e 's,modules,include,' `
 		if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then
 			AC_MSG_ERROR(Failed to figure out Pike module and include directories)
 		fi
@@ -83,7 +83,9 @@
     PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'`   
 	AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support])
     PHP_SELECT_SAPI(caudium, shared, caudium.c)
-	INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP4.so"
+    dnl FIXME: This is the ugliest hack in the world!
+    dnl INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)$withval/lib/$PIKE_VERSION/ && \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$withval/lib/$PIKE_VERSION/PHP4.so"
+	INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)$withval/lib/$PIKE_VERSION/ && \$(INSTALL) -m 0755 .$SAPI_SHARED \$(INSTALL_ROOT)$withval/lib/$PIKE_VERSION/PHP4.so"
 	RESULT="	*** Pike binary used:         $PIKE
 	*** Pike include dir(s) used: $PIKE_INCLUDE_DIR
 	*** Pike version:             $PIKE_VERSION"
diff -urN php-4.3.7.orig/scripts/Makefile.frag php-4.3.7/scripts/Makefile.frag
--- php-4.3.7.orig/scripts/Makefile.frag	2003-12-01 11:12:42.000000000 -0500
+++ php-4.3.7/scripts/Makefile.frag	2004-06-08 02:22:28.000000000 -0400
@@ -3,8 +3,8 @@
 # Build environment install
 #
 
-phpincludedir = $(includedir)/php
-phpbuilddir = $(libdir)/build
+phpincludedir = $(includedir)/php4
+phpbuilddir = $(prefix)/lib/php4/build
 
 BUILD_FILES = \
 	scripts/phpize.m4 \
diff -urN php-4.3.7.orig/scripts/php-config.in php-4.3.7/scripts/php-config.in
--- php-4.3.7.orig/scripts/php-config.in	2003-01-28 10:02:08.000000000 -0500
+++ php-4.3.7/scripts/php-config.in	2004-06-08 02:22:28.000000000 -0400
@@ -2,8 +2,8 @@
 
 prefix="@prefix@"
 version="@PHP_VERSION@"
-includedir="@includedir@/php"
-includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend"
+includedir="@includedir@/php4"
+includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend $(getconf LFS_CFLAGS)"
 ldflags="@PHP_LDFLAGS@"
 libs="@EXTRA_LIBS@"
 extension_dir='@EXTENSION_DIR@'
diff -urN php-4.3.7.orig/scripts/phpize.in php-4.3.7/scripts/phpize.in
--- php-4.3.7.orig/scripts/phpize.in	2003-11-13 22:21:15.000000000 -0500
+++ php-4.3.7/scripts/phpize.in	2004-06-08 02:22:28.000000000 -0400
@@ -3,8 +3,8 @@
 # Variable declaration
 prefix='@prefix@'
 exec_prefix="`eval echo @exec_prefix@`"
-phpdir="`eval echo @libdir@`/build"
-includedir="`eval echo @includedir@`/php"
+phpdir="$prefix/lib/php4/build"
+includedir="$prefix/include/php4"
 builddir="`pwd`"
 
 FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
diff -urN php-4.3.7.orig/sapi/cli/php.1.in php-4.3.7/sapi/cli/php.1.in
--- php-4.3.7.orig/sapi/cli/php.1.in	2003-08-04 18:30:04.000000000 -0400
+++ php-4.3.7/sapi/cli/php.1.in	2004-06-08 02:22:28.000000000 -0400
@@ -112,13 +112,17 @@
 or script is read from stdin
 .SH FILES
 .TP 15
-.B php\-cli.ini
+.B /etc/php4/cli/php.ini
 The configuration file for the CLI version of PHP.
 .TP
-.B php.ini
-The standard configuration file will only be used when 
-.B php\-cli.ini
-cannot not be found.
+.B /etc/php4/cgi/php.ini
+The configuration file for the CGI version of PHP.
+.TP
+.B /etc/php4/apache/php.ini
+The configuration file for the version of PHP that apache uses.
+.TP
+.B /etc/php4/apache2/php.ini
+The configuration file for the version of PHP that apache2 uses.
 .SH EXAMPLES
 .TP 5
 \fIphp -r 'echo "Hello World\\n";'\fP
--- php-4.3.8/php.ini-dist	2004-05-17 10:31:13.000000000 -0600
+++ php4-4.3.8/php.ini-dist	2004-08-23 23:02:14.000000000 -0600
@@ -408,7 +408,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ; UNIX: "/path1:/path2"  
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
 ;
 ; Windows: "\path1;\path2"
 ;include_path = ".;c:\php\includes"
@@ -425,7 +425,7 @@
 user_dir =
 
 ; Directory in which the loadable extensions (modules) reside.
-extension_dir = "./"
+; extension_dir = "./"
 
 ; Whether or not to enable the dl() function.  The dl() function does NOT work
 ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
@@ -534,54 +534,10 @@
 ; needs to go here.  Specify the location of the extension with the
 ; extension_dir directive above.
 
+; Example lines:
 
-;Windows Extensions
-;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
-;
-;extension=php_mbstring.dll
-;extension=php_bz2.dll
-;extension=php_cpdf.dll
-;extension=php_crack.dll
-;extension=php_curl.dll
-;extension=php_db.dll
-;extension=php_dba.dll
-;extension=php_dbase.dll
-;extension=php_dbx.dll
-;extension=php_domxml.dll
-;extension=php_exif.dll
-;extension=php_fdf.dll
-;extension=php_filepro.dll
-;extension=php_gd2.dll
-;extension=php_gettext.dll
-;extension=php_hyperwave.dll
-;extension=php_iconv.dll
-;extension=php_ifx.dll
-;extension=php_iisfunc.dll
-;extension=php_imap.dll
-;extension=php_interbase.dll
-;extension=php_java.dll
-;extension=php_ldap.dll
-;extension=php_mcrypt.dll
-;extension=php_mhash.dll
-;extension=php_mime_magic.dll
-;extension=php_ming.dll
-;extension=php_mssql.dll
-;extension=php_msql.dll
-;extension=php_oci8.dll
-;extension=php_openssl.dll
-;extension=php_oracle.dll
-;extension=php_pdf.dll
-;extension=php_pgsql.dll
-;extension=php_printer.dll
-;extension=php_shmop.dll
-;extension=php_snmp.dll
-;extension=php_sockets.dll
-;extension=php_sybase_ct.dll
-;extension=php_w32api.dll
-;extension=php_xmlrpc.dll
-;extension=php_xslt.dll
-;extension=php_yaz.dll
-;extension=php_zip.dll
+;extension=mysql.so
+;extension=gd.so
 
 
 ;;;;;;;;;;;;;;;;;;;
@@ -823,7 +779,7 @@
 ;         You can use the script in the ext/session dir for that purpose.
 ; NOTE 2: See the section on garbage collection below if you choose to
 ;         use subdirectories for session storage
-;session.save_path = /tmp
+;session.save_path = /var/lib/php4
 
 ; Whether to use cookies.
 session.use_cookies = 1
@@ -856,7 +812,10 @@
 ; e.g. 1/100 means there is a 1% chance that the GC process starts
 ; on each request.
 
-session.gc_probability = 1
+; This is disabled in the Debian packages, due to the strict permissions
+; on /var/lib/php4.  Instead of setting this here, see the cronjob at
+; /etc/cron.d/php4, which uses the session.gc_maxlifetime setting below
+;session.gc_probability = 0
 session.gc_divisor     = 100
 
 ; After this number of seconds, stored data will be seen as 'garbage' and
--- php-4.3.8/php.ini-recommended	2004-05-17 10:31:14.000000000 -0600
+++ php4-4.3.8/php.ini-recommended	2004-08-23 23:02:50.000000000 -0600
@@ -423,7 +423,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ; UNIX: "/path1:/path2"  
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
 ;
 ; Windows: "\path1;\path2"
 ;include_path = ".;c:\php\includes"
@@ -440,7 +440,7 @@
 user_dir =
 
 ; Directory in which the loadable extensions (modules) reside.
-extension_dir = "./"
+;extension_dir = "./"
 
 ; Whether or not to enable the dl() function.  The dl() function does NOT work
 ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
@@ -549,55 +549,10 @@
 ; needs to go here.  Specify the location of the extension with the
 ; extension_dir directive above.
 
+; Example lines:
 
-;Windows Extensions
-;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
-;
-;extension=php_mbstring.dll
-;extension=php_bz2.dll
-;extension=php_cpdf.dll
-;extension=php_crack.dll
-;extension=php_curl.dll
-;extension=php_db.dll
-;extension=php_dba.dll
-;extension=php_dbase.dll
-;extension=php_dbx.dll
-;extension=php_domxml.dll
-;extension=php_exif.dll
-;extension=php_fdf.dll
-;extension=php_filepro.dll
-;extension=php_gd2.dll
-;extension=php_gettext.dll
-;extension=php_hyperwave.dll
-;extension=php_iconv.dll
-;extension=php_ifx.dll
-;extension=php_iisfunc.dll
-;extension=php_imap.dll
-;extension=php_interbase.dll
-;extension=php_java.dll
-;extension=php_ldap.dll
-;extension=php_mcrypt.dll
-;extension=php_mhash.dll
-;extension=php_mime_magic.dll
-;extension=php_ming.dll
-;extension=php_mssql.dll
-;extension=php_msql.dll
-;extension=php_oci8.dll
-;extension=php_openssl.dll
-;extension=php_oracle.dll
-;extension=php_pdf.dll
-;extension=php_pgsql.dll
-;extension=php_printer.dll
-;extension=php_shmop.dll
-;extension=php_snmp.dll
-;extension=php_sockets.dll
-;extension=php_sybase_ct.dll
-;extension=php_w32api.dll
-;extension=php_xmlrpc.dll
-;extension=php_xslt.dll
-;extension=php_yaz.dll
-;extension=php_zip.dll
-
+;extension=mysql.so
+;extension=gd.so
 
 ;;;;;;;;;;;;;;;;;;;
 ; Module Settings ;
@@ -829,7 +783,7 @@
 ; Argument passed to save_handler.  In the case of files, this is the path
 ; where data files are stored. Note: Windows users have to change this 
 ; variable in order to use PHP's session functions.
-;session.save_path = /tmp
+;session.save_path = /var/lib/php4
 
 ; Whether to use cookies.
 session.use_cookies = 1
@@ -862,7 +817,10 @@
 ; e.g. 1/100 means there is a 1% chance that the GC process starts
 ; on each request.
 
-session.gc_probability = 1
+; This is disabled in the Debian packages, due to the strict permissions
+; on /var/lib/php4.  Instead of setting this here, see the cronjob at
+; /etc/cron.d/php4, which uses the session.gc_maxlifetime setting below
+;session.gc_probability = 0
 session.gc_divisor     = 1000
 
 ; After this number of seconds, stored data will be seen as 'garbage' and
--- php-4.3.8/ext/session/session.c	2004-07-13 07:15:29.000000000 -0600
+++ php4-4.3.8/ext/session/session.c	2004-08-23 22:59:58.000000000 -0600
@@ -140,12 +140,12 @@
 #ifdef PHP_WIN32
 	STD_PHP_INI_ENTRY("session.save_path",          "",          PHP_INI_ALL, OnUpdateSaveDir,save_path,          php_ps_globals,    ps_globals)
 #else
-	STD_PHP_INI_ENTRY("session.save_path",          "/tmp",      PHP_INI_ALL, OnUpdateSaveDir,save_path,          php_ps_globals,    ps_globals)
+	STD_PHP_INI_ENTRY("session.save_path",          "/var/lib/php4",      PHP_INI_ALL, OnUpdateString,save_path,          php_ps_globals,    ps_globals)
 #endif
 	STD_PHP_INI_ENTRY("session.name",               "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name,       php_ps_globals,    ps_globals)
 	PHP_INI_ENTRY("session.save_handler",           "files",     PHP_INI_ALL, OnUpdateSaveHandler)
 	STD_PHP_INI_BOOLEAN("session.auto_start",       "0",         PHP_INI_ALL, OnUpdateBool,   auto_start,         php_ps_globals,    ps_globals)
-	STD_PHP_INI_ENTRY("session.gc_probability",     "1",         PHP_INI_ALL, OnUpdateInt,    gc_probability,     php_ps_globals,    ps_globals)
+	STD_PHP_INI_ENTRY("session.gc_probability",     "0",         PHP_INI_ALL, OnUpdateInt,    gc_probability,     php_ps_globals,    ps_globals)
 	STD_PHP_INI_ENTRY("session.gc_divisor",         "100",       PHP_INI_ALL, OnUpdateInt,    gc_divisor,         php_ps_globals,    ps_globals)
 	STD_PHP_INI_ENTRY("session.gc_maxlifetime",     "1440",      PHP_INI_ALL, OnUpdateInt,    gc_maxlifetime,     php_ps_globals,    ps_globals)
 	PHP_INI_ENTRY("session.serialize_handler",      "php",       PHP_INI_ALL, OnUpdateSerializer)

