php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2461 Can't use PHP CGI for PHP-scripts outside of the _webserver_ document root
Submitted: 1999-10-07 06:19 UTC Modified: 2000-04-02 00:19 UTC
From: ewas at dds dot nl Assigned:
Status: Closed Package: Installation problem
PHP Version: 3.0.12 OS: Mandrake-linux 6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ewas at dds dot nl
New email:
PHP Version: OS:

 

 [1999-10-07 06:19 UTC] ewas at dds dot nl
I (try to) use the PHP CGI-version under Apache 1.3.9 with redirection by means of an Action directive as outlined in the PHP manual. My php scripts are in a subdirectory under my homedirectory  /home/user/webdocs. The PHP CGI binary is under /home/user/cgi-bin/php. Apache is configured (using Alias and ScriptAlias) so that /home/user/webdocs/ is mapped to http://my.host/user/ and /home/user/cgi-bin/ to http://my.host/cgi-bin-user/ 
The PHP doc_root is set to /home/user/webdocs in php.ini 

When I call one of my php-scripts like http://my.host/user/test.php3 PHP complains it can't find the file: /home/user/webdocs/user/test.php3, which of coarse doen't exist, it should look for /home/user/webdocs/test.php3

It seems that PHP doesn't use the PATH_TRANSLATED  environment variable set by apache (which is the location of the page being called on the filesystem) for opening the PHP page.  Instead it seems to look for doc_root/$REDIRECT_URL . This works fine as long as the PHP pages are under the web server's document root; then doc_root/$REDIRECT_URL is equal to PATH_TRANSLATED (which is the location of the php page called on the filesystem). In my case however my php documents are outside of the web server's document root, so doc_root/$REDIRECT_URL is not the location of the php pages on the filesystem.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-04-02 00:19 UTC] rasmus at cvs dot php dot net
If you compiled PHP with --with-discard-path it should pick up PATH_TRANSLATED
correctly.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 15:01:32 2025 UTC