-Configuration of your Netscape/iPlanet/Sun Webserver for PHP5
+Configuration of your Netscape/iPlanet/Sun Webserver for PHP6
-----------------------------------------------------------------
These instructions are targetted at Netscape Enterprise Web Server and
for iPlanet/Sun Webserver 6.0 and above however at the end of the
<path-to-server>/https-servername/config/magnus.conf file:
- Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/path/to/phplibrary"
- Init fn=php5_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"]
+ Init fn="load-modules" funcs="php6_init,php6_execute,php6_auth_trans" shlib="/path/to/phplibrary"
+ Init fn=php6_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"]
The "shlib" will vary depending on your OS:
- Unix: "<path-to-server>/bin/libphp5.so".
- Windows: "c:/path/to/php5/php5nsapi.dll"
+ Unix: "<path-to-server>/bin/libphp6.so".
+ Windows: "c:/path/to/php6/php6nsapi.dll"
In obj.conf (for virtual server classes [Sun 6.0+] in their vserver.obj.conf):
# For boolean ini-keys please use 0/1 as value, NOT "On","Off",... (this will not work
# correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression="On"
- Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value ...]
+ Service fn="php6_execute" type="magnus-internal/x-httpd-php" [inikey=value ...]
.
.
.
<Object name="x-httpd-php">
ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
- Service fn="php5_execute" [inikey=value ...]
+ Service fn="php6_execute" [inikey=value ...]
</Object>
After that you can configure a directory in the Administration server and assign it
Authentication for the entire server, add the following line:
<Object name="default">
- AuthTrans fn=php5_auth_trans
+ AuthTrans fn=php6_auth_trans
.
.
.
To use PHP Authentication on a single directory, add the following:
<Object ppath="d:\path\to\authenticated\dir\*">
- AuthTrans fn=php5_auth_trans
+ AuthTrans fn=php6_auth_trans
</Object>
or similar. Add the following line to the object in obj.conf for
every error page you want to overwrite:
- Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...]
+ Error fn="php6_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...]
where XXX ist the HTTP error code. Please delete any other Error
directives which could interfere with yours.
replace the corresponding default Service line for
type="magnus-internal/directory" in obj.conf with the following:
- Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...]
+ Service fn="php6_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...]
For both error and directory listing pages the original URI and
translated URI are in the variables $_SERVER['PATH_INFO'] and
fails and nsapi_virtual() is disabled.
If this is the case, try the following:
-Add the following parameter to php5_init in magnus.conf:
+Add the following parameter to php6_init in magnus.conf:
- Init fn=php5_init ... server_lib="ns-httpdXX.dll"
+ Init fn=php6_init ... server_lib="ns-httpdXX.dll"
where XX is the correct DLL version number. To get it, look in the server-root
for the correct DLL name. The DLL with the biggest filesize is the right one.
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 6 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
/* try user specified server_lib */
module = GetModuleHandle(nsapi_dll);
if (!module) {
- log_error(LOG_WARN, "php5_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll);
+ log_error(LOG_WARN, "php6_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll);
}
} else {
/* find a LOADED dll module from nsapi_dlls */
}
}
-void NSAPI_PUBLIC php5_close(void *vparam)
+void NSAPI_PUBLIC php6_close(void *vparam)
{
if (nsapi_sapi_module.shutdown) {
nsapi_sapi_module.shutdown(&nsapi_sapi_module);
tsrm_shutdown();
- log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module");
+ log_error(LOG_INFORM, "php6_close", NULL, NULL, "Shutdown PHP Module");
}
/*********************************************************
/ init SAF
/
-/ Init fn="php5_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"]
+/ Init fn="php6_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"]
/ Initialize the NSAPI module in magnus.conf
/
/ php_ini: gives path to php.ini file
/ servact_* functions
/
/*********************************************************/
-int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq)
+int NSAPI_PUBLIC php6_init(pblock *pb, Session *sn, Request *rq)
{
php_core_globals *core_globals;
char *strval;
core_globals = ts_resource(core_globals_id);
- /* look if php_ini parameter is given to php5_init */
+ /* look if php_ini parameter is given to php6_init */
if (strval = pblock_findval("php_ini", pb)) {
nsapi_sapi_module.php_ini_path_override = strdup(strval);
}
#ifdef PHP_WIN32
- /* look if server_lib parameter is given to php5_init
+ /* look if server_lib parameter is given to php6_init
* (this disables the automatic search for the newest ns-httpdXX.dll) */
if (strval = pblock_findval("server_lib", pb)) {
nsapi_dll = strdup(strval);
sapi_startup(&nsapi_sapi_module);
nsapi_sapi_module.startup(&nsapi_sapi_module);
- daemon_atrestart(&php5_close, NULL);
+ daemon_atrestart(&php6_close, NULL);
log_error(LOG_INFORM, pblock_findval("fn", pb), sn, rq, "Initialized PHP Module (%d threads exspected)", threads);
return REQ_PROCEED;
/*********************************************************
/ normal use in Service directive:
/
-/ Service fn="php5_execute" type=... method=... [inikey=inivalue inikey=inivalue...]
+/ Service fn="php6_execute" type=... method=... [inikey=inivalue inikey=inivalue...]
/
/ use in Service for a directory to supply a php-made directory listing instead of server default:
/
-/ Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
+/ Service fn="php6_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
/
/ use in Error SAF to display php script as error page:
/
-/ Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
-/ Error fn="php5_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
+/ Error fn="php6_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
+/ Error fn="php6_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...]
/
/*********************************************************/
-int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq)
+int NSAPI_PUBLIC php6_execute(pblock *pb, Session *sn, Request *rq)
{
int retval;
nsapi_request_context *request_context;
/ will pass authentication through to php, and allow us to
/ check authentication with our scripts.
/
-/ php5_auth_trans
+/ php6_auth_trans
/ main function called from netscape server to authenticate
/ a line in obj.conf:
-/ funcs=php5_auth_trans shlib="path/to/this/phpnsapi.dll"
+/ funcs=php6_auth_trans shlib="path/to/this/phpnsapi.dll"
/ and:
/ <Object ppath="path/to/be/authenticated/by/php/*">
-/ AuthTrans fn="php5_auth_trans"
+/ AuthTrans fn="php6_auth_trans"
/*********************************************************/
-int NSAPI_PUBLIC php5_auth_trans(pblock * pb, Session * sn, Request * rq)
+int NSAPI_PUBLIC php6_auth_trans(pblock * pb, Session * sn, Request * rq)
{
/* This is a DO NOTHING function that allows authentication
* information