Re: Environment once more
Martijn Grendelman <martijn-FwI+/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Jeffrey, >> At the risk of being flamed for asking the obvious, I'd like to go >> down the path of FastCGI application environment once more. >> >> I have spent the better part of yesterday searching and reading about >> environment variables and the ways they can and cannot be used with >> Apache and mod_fastcgi. >> >> I am using FastCGI with PHP and suExec. PHP is started through a >> wrapper script, that has to make some decisions (which php.ini to use, >> among others) based on the virtual host it is running for, before >> exec'ing PHP. >> >> Is there _any_ way to pass this kind of information from Apache to the >> wrapper script? I know SetEnv, PassEnv and the like won't cut it, and >> with -initial-env, I can only pass data from Apache's environment, >> which is useless to me. >> >> Would it be hard, or would there be any drawbacks, or unacceptabel >> security implications to have the FastCGI process manager set up an >> environment based on Apache's mod_env before it forks? I am not a C >> programmer, so there's no way I can implement this myself. >> >> I have seen similar questions in the list archives many times, and >> IMHO it's understandable that people want to be able to do this. Have >> I missed anything? >> >> > Perhaps I don't understand what you are trying to accomplish, but this > is the way I use FastCGI. The url first contains a /vms that denotes > that it's FastCGI, then an environment or area like /abc, then the > command that I want the FastCGI server to execute then any additional > info. Therefore a complete url looks like > https://www.xyz.com/vms/abc/Catalog/Item1. Each area has a separate > FastCGI server on a different port so what I believe you need the > environment variables for are basically set up once in the FastCGI > startup script. My setup isn't nearly as complicated as that. All I need is a separate instance of PHP for each user or virtual host. This is accomplished with dynamic FastCGI servers. Perhaps I must add that this is a shared webhosting environment. PHP is started through a wrapper script, that basically has to do two things: - decide which php.ini to use. I have a separate files for PHP safe mode and for non-safe mode, and I may grow the need to have more. - set a couple of PHP ini-directives using the '-d' command line option, the most important of which is 'sendmail_path'. We use this to make sure that Sendmail is called with a '-f' option, to make sure a valid envelope sender is set by default, when a user calls the mail() function. I want my users to handle their own bounces. The former thing is now done with two different 'Action' directives in Apache's conf, that start different versions of the wrapper script, and we use different 'AddHandler' directives in virtual hosts to differentiate between the different PHP profiles, but that will get more complex when I need more PHP profiles. The latter thing is simply not possible with FastCGI, if I understand things correctly. And all I really want to do is something like <VirtualHost> SetEnv PHP_MODE safe SetEnv PHP_MAIL_SENDER [email protected] <VirtualHost> and read these in the wrapper script to take the appropriate action. Hope this clarifies things a bit. Best regards, Martijn Grendelman ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/
smime.p7s
(application/x-pkcs7-signature, 3.2 KB) - not displayed