Re: [Pi3web-users] PATH_TRANSLATED when using SAPI
Brought to you by:
zimpel
From: <zi...@t-...> - 2004-04-07 06:39:43
|
1. I think you need to change setting register_globals=On in PHP.INI. Look into the php documentation, e.g. at http://de2.php.net/variables.predefined. PATH_TRANSLATED is only available, if a pathinfo is provided, e.g. URI is /pidocs/features/test.php3/foo.txt. In that case, these variables are set to - SCRIPT_NAME /pidocs/features/test.php3 PATH_INFO /foo.txt PATH_TRANSLATED c:\Pi3Web\WebRoot\foo.txt Note, that the configuration of Pi3Web, that is used for PHP by default has switched off the parameter 'PathInfo' of the PathMapper (in deed no specific mapper is used for PHP scripts). This means you cannot handle URI's like above without configuration changes. 1) 2. There are several ways thinkable for a solution: - by backend handler: the dynamic server extension (e.g. PHP script) could perform all actions and add the response header (Content-type) itself - by Pi3Web configuration (determine the file extension in the URI, perform a specific mapping, invoke the specific handler object, e.g. a PHP script, replace the response header - You could also write a native (C++) handler, which can utilize the Pi3Web infrastructure ( PiAPI, Pi2API, Pi3API) The order reflects the difficulty of these 3 approaches. -- regards, Holger 1) I know, this isn't an optimal solution but I had to weight out simplicity of the configuration with the ease of use (it is required to execute PHP scripts from any mapped directory). This makes the difference to CGI, where all CGI programs are in /cgi-bin/ and this is a significant difference of PHP CGI and PHP SAPI. I will rethink this configuration for the next release. Celvin schrieb: > Hi! > > After PHP now finally works again, I was wondering on how to add > variables to the SAPI environment. > > Although the docs state that for PHP using SAPI, PATH_TRANSLATED is > indeed available, I couldn't access it (and I have verified it isn't > passed via phpinfo), and I need to have some additional variables > available, so if it's possible, it'd be nice to know anyway... > > Another topic (regarding file types) is, if it is actually needed to > define a MIME type for every extension the server should handle, i.e. I > want an external application / library to handle .BAK files, as there > are different people developing, so .BAK files should be passed through > an external application that verifies access for a given user and either > outputs his own files only, or redirects him to an error page. > Access verification is done through an external DB, so checking file > types via Pi3 isn't an option. > > To summarize: would be defining an internal MIME type and a handler the > prefered way of doing this? > > > Well, thanks again in advance ;) > > Regards, Celvin > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Pi3web-users mailing list > Pi3...@li... > https://lists.sourceforge.net/lists/listinfo/pi3web-users > |