Ticket #3515 (closed enhancement: fixed)
Improving the FastCGI stub for standalone usage
| Reported by: | spillgroup | Owned by: | weyrick |
|---|---|---|---|
| Priority: | immediate | Milestone: | |
| Component: | FastCGI | Version: | trunk |
| Severity: | feature | Keywords: | |
| Cc: |
Description
When trying to use a statically compiled FastCGI application standalone (using the -e switch) in conjunction with Lighttpd, I faced several problems. The attached patch tries to solve those. I have not extensively tested this, so your mileage may vary!
Troubles:
1. Some servers provide path info through the PATH_INFO var, others through SCRIPT_NAME. This was already being taken into consideration for the PHP_SELF variable, but not for the script execution path. Lazy fix by reusing PHP_SELF for the script execution path.
2. A chdir was being done to "web-doc-root" appended by the contents of the "PATH_INFO" var. This made no sense to me. I think it should simply do a chdir to "web-doc-root".
3. Lighttpd passes its current document root through the "DOCUMENT_ROOT" environment variable. Let the stub pick it up and use it when it has nothing better.
Furthermore I placed some quotes around the url in the 404 handler. This makes debugging easier when dealing with either empty or complex url's easier.
