Oops.. I forgot the files... Here they are! Le lun 06/01/2003 à 12:49, Jean-Michel Dault a écrit : > Le lun 06/01/2003 à 07:24, Ananth Kesari a écrit : > > What we are looking for is to find out whether or not the current > > autotool input files of PHP support the ability to produce a spearate > > phplib.l and the appropriate "main" module - one for Apache 1.3, one for > > Apache 2.0, one for command line etc. each of which can use the same > > phplib.l ? > > > > We tried to figure this out on Linux, but it appears that this seems > > not to be supported. Are we correct in our findings? Or is there really > > a way of doing the above of having different shared modules? > > It is not supported officially, but there's a way to do it. > > As I promised a couple of days ago, here is a solution that works for > me, though it's not very pretty. I could of course modify the m4 files, > but it's left as an exercise to the readers of this list ;-) > > Here is the procedure: > 1) Patch the makefile.global and configure script using the > "shared-patch" I enclosed in this mail. This will compile a shared > library containing the PHP core, and will patch the CGI and CLI version > so they use this library. > > 2) do ./configure, with all the options that you want, but do *not* use > the --with-apache or --with-apxs options. You want to compile first the > CGI and CLI binaries and the shared library. > > 3) do a make, but do not do a make install yet. > > 4) To compile the Apache 1.3 module, use the enclosed "do1.3" script. > If your Apache environment is setup correctly, you will have a > libphp4.so in the sapi/apache directory. This is the Apache DSO that > you'll need to copy in your Apache 1.3 modules directory. > > 5) To compile the Apache 2.0 module, use the enclosed "do2.0" script. > If your Apache environment is setup correctly, you will have a > mod_php4.so in the sapi/apache2filter/.libs directory. This is the > Apache 2.0 DSO that you'll need to copy in your Apache 2.0 modules > directory. > > Please note that to be able to compile both Apache 1.3 and Apache 2.0 > modules, you need two different apxs binaries and two different > apache include directories. I personnaly use the following dirs: > Apache 1.3: /usr/sbin/apxs and /usr/include/apache for 1.3 > Apache 2.0: /usr/sbin/apxs2 and /usr/include/apache2 > > 6) Finally, place the libphp_common library in /usr/lib > mv libphp_common.so libphp_common.so.430 > ln -s libphp_common.so.430 libphp_common > cp libphp_common* /usr/lib > > 7) Now do a "make install", "make install-cli" > > 8) Finally, you can install sapi/cgi/php to whatever location/name you > want that is different from the CLI version. > > 9) You'll still need to tweak your httpd.conf to put the required > LoadModule, AddModule and AddType directives. > > 10) Or better yet, install Mandrake Linux and have it already > pre-configured ;-) > > > Regards, > > Jean-Michel Dault > Apache/PHP Packager > Mandrake Linux >
diff -urp php-4.3.0.orig/configure php-4.3.0/configure --- php-4.3.0.orig/configure 2002-12-27 00:50:56.000000000 -0400 +++ php-4.3.0/configure 2003-01-04 05:52:46.000000000 -0400 @@ -5681,10 +5681,10 @@ if test "$PHP_SAPI_CLI" != "no"; then BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" ;; *) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" + BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) -L. -lphp_common \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" ;; esac - INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/php" + INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/php-cli" PHP_VAR_SUBST="$PHP_VAR_SUBST BUILD_CLI" @@ -8448,7 +8448,7 @@ EOF BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" ;; *) - BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" + BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) -L. -lphp_common \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" ;; esac diff -urp php-4.3.0.orig/Makefile.global php-4.3.0/Makefile.global --- php-4.3.0.orig/Makefile.global 2002-11-12 13:40:38.000000000 -0400 +++ php-4.3.0/Makefile.global 2003-01-04 05:48:11.000000000 -0400 @@ -6,7 +6,10 @@ DEFS = -DPHP_ATOM_INC -I$(top_builddir)/ COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) -all: $(all_targets) +all: libphp_common.so $(all_targets) + +libphp_common.so: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) + ld -shared -soname libphp_common.so.430 -lc $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ build-modules: $(PHP_MODULES)
#!/bin/bash cd sapi/apache /usr/sbin/apxs -c -I. -I../../main -I../../include \ -I../../Zend -I../../TSRM -I../.. \ -L../.. -lphp_common \ -lpthread -lgdbm -lmm \ -DHAVE_AP_COMPAT_H \ php_apache.c sapi_apache.c mod_php4.c \ ../../main/internal_functions.c \ -o libphp4.so cd ../..
#!/bin/bash cd sapi/apache2filter cp sapi_apache2.c mod_php4.c /usr/sbin/apxs2 -I. -I../../main -I../../include \ -I../../Zend -I../../TSRM -I../.. \ -L../.. -lphp_common \ `apr-config --link-ld --libs` \ `apu-config --link-ld --libs` -ldb \ -c mod_php4.c apache_config.c php_functions.c \ ../../main/internal_functions.c cd ../..
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php