|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 35 = ?
Subscribe to this entry?

 [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 and /home/user/cgi-bin/ to 
The PHP doc_root is set to /home/user/webdocs in php.ini 

When I call one of my php-scripts like 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.


Add a Patch

Pull Requests

Add a Pull Request


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
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jan 27 20:03:46 2023 UTC