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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2022 The PHP Group
All rights reserved.
Last updated: Wed Nov 30 04:05:54 2022 UTC