Re: Zeus support for PHP4

From: Date: Fri, 31 Mar 2000 09:40:59 +0000
Subject: Re: Zeus support for PHP4
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-17465@lists.php.net to get a copy of this message
Hello again, Here's an updated patch for Zeus + PHP4 I'd like to add this to the CVS myself, but since I do not have access yet, this is impossible. Please could someone add in these changes? Thanks, Ben diff -Naur php-cvs2/INSTALL php-cvs/INSTALL --- php-cvs2/INSTALL Fri Mar 31 10:06:54 2000 +++ php-cvs/INSTALL Fri Mar 31 10:16:03 2000 @@ -11,6 +11,8 @@ If you want both PHP 3 and 4 modules in the same Apache server, check the bottom of this file for instructions. +INSTALLATION WITH THE ZEUS WEB SERVER: +--Please see the 'README.Zeus' file included in this distribution QUICK INSTALL (DSO) diff -Naur php-cvs2/README.Zeus php-cvs/README.Zeus --- php-cvs2/README.Zeus Thu Jan 1 01:00:00 1970 +++ php-cvs/README.Zeus Fri Mar 31 10:16:23 2000 @@ -0,0 +1,79 @@ +Using PHP4 with the Zeus Web Server +----------------------------------- + +Zeus fully supports running PHP in combination with our webserver. A +significant improvement in PHP 4 is that you can now run PHP as an +ISAPI module, giving great performance benefits over traditional CGI +code. + +Note that you will need to be running at least version 3.3.6 of the +webserver. If you are running an earlier version, please see our +website (http://www.zeus.com) for upgrade instructions. + + +To build the ISAPI version of PHP, start the configuration with: + +./configure --with-zeus=/usr/local/zeus + +Obviously, replace /usr/local/zeus with the location of where you have +installed Zeus on your machine. For PHP to build successfully, you +need to have 3.3.6 already installed, because the code relies on the +presence of header files provided with the latest version. + +You may have to adjust the environment variable LDFLAGS in order to +link in extra libraries. This depends on the platform on which you are +building and also on the compiler used (see below). A standard +GNU/Linux install with GCC should build fine with no changes. + + +Configuring the webserver +------------------------- + +After running 'make' and 'make install', you will have a 'libphp4.so' +file. Copy this file into a directory reserved for ISAPI +binaries. Now, perform the following steps for each virtual server +that you wish to run PHP on: + +1) On the Admin server, go to 'edit server->path mapping' +2) Add an alias to the directory with libphp4.so in it, mapped to + /isapi/ (or a location of your choice). Make sure you set the alias + type to ISAPI. +3) Click 'update' +4) Add a handler for file extension .php to be run by /isapi/libphp4.so +5) Click 'update', then go back to the previous page. +6) Click on the 'module configuration' button, ensure that ISAPI + support is ticked. +7) Click on the ISAPI link. At the bottom of the page, click the + checkbox for running ISAPI extensions 'out of process'. +8) Click 'update'. Then restart the virtual server. Done! + + +Troubleshooting +--------------- + +*) Why does my PHP library fail to load? + +After configuring Zeus, if you get a '502 Bad Gatway' error when +accessing a PHP page, there are problems loading the PHP +library. Check the error log ($ZEUSHOME/web/log/errors) for errors. + +Failing to load the PHP ISAPI module is likely to be due to unresolved +symbols in the module. A way to check for this is to visit our support +page at http://support.zeus.com/faq/entries/isapi_error.html and run +the program there on your libphp4.so. It will list any unresolved +symbols. + +*) My libphp4.so has unresolved symbols. How do I fix this? + +You must statically compile in the appropriate libraries that contain +these symbols! This depends greatly on the platform you are running +PHP on. Adjust the environment variable LDFLAGS as appropriate. + +For example, on Solaris 7, building with gcc, it was necessary to set +LDFLAGS to '-L/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.7/egcs-2.91.66 +-L/usr/local/egcs/lib -lgcc' on a particular machine. + + +For more information and help with Zeus, please visit our website: + +http://www.zeus.com diff -Naur php-cvs2/sapi/isapi/php4isapi.c php-cvs/sapi/isapi/php4isapi.c --- php-cvs2/sapi/isapi/php4isapi.c Fri Mar 31 10:06:56 2000 +++ php-cvs/sapi/isapi/php4isapi.c Fri Mar 31 10:15:31 2000 @@ -20,9 +20,12 @@ #ifdef PHP_WIN32 # include <windows.h> # include <process.h> +# define SEPARATOR '\\' #else # define __try # define __except(val) +# define __declspec(foo) +# define SEPARATOR '/' #endif #include <httpext.h> @@ -37,7 +40,9 @@ #include "php_ini.h" #ifdef WITH_ZEUS -#include "zeus.h" +# include "httpext.h" +# include <errno.h> +# define GetLastError() errno #endif #define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION") @@ -220,9 +225,7 @@ header_info.pszStatus = status_buf; break; } -#ifndef WITH_ZEUS header_info.cchStatus = strlen(header_info.pszStatus); -#endif header_info.pszHeader = combined_headers; header_info.cchHeader = total_length; lpECB->dwHttpStatusCode = SG(sapi_headers).http_response_code; @@ -452,12 +455,12 @@ SG(request_info).content_type = lpECB->lpszContentType; SG(request_info).content_length = lpECB->cbTotalBytes; { - char *path_end = strrchr(SG(request_info).path_translated, '\\'); + char *path_end = strrchr(SG(request_info).path_translated, SEPARATOR); if (path_end) { *path_end = 0; PHP_CHDIR(SG(request_info).path_translated); - *path_end = '\\'; + *path_end = SEPARATOR; } } if (!bFilterLoaded) { /* we don't have valid ISAPI Filter information */ @@ -490,7 +493,11 @@ BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) { pVer->dwExtensionVersion = HSE_VERSION; +#ifdef WITH_ZEUS + strncpy( pVer->lpszExtensionDesc, sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); +#else lstrcpyn(pVer->lpszExtensionDesc, sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); +#endif return TRUE; } -- Ben Mansell, <ben@zeus.com> Zeus Technology Ltd Download the world's fastest webserver! Universally Serving the Net T:+44(0)1223 525000 F:+44(0)1223 525100 http://www.zeus.com Newton House, Cambridge Business Park, Cambridge, CB4 0WZ, ENGLAND

« previous php.dev (#17465) next »