php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17806 SCRIPT_NAME wrong in CGI mode
Submitted: 2002-06-17 15:50 UTC Modified: 2002-07-07 12:23 UTC
From: schirmer at taytron dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.1.2 OS: Linux
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: schirmer at taytron dot net
New email:
PHP Version: OS:

 

 [2002-06-17 15:50 UTC] schirmer at taytron dot net
Script is described in the doc as:

'SCRIPT_NAME'
Contains the current script's path. This is useful for pages which need to point to themselves. 

This is true for the mod_php version. But if you are running php as CGI (under Apache at least) it isn't true. SCRIPT_NAME then points to the php bin path, not the script name.

Example (Apache conf):

ScriptAlias /php-engine /web/tools/php
Action x-php-cgi /phh-engine/php

would result in a SCRIPT_NAME of

/php-engine/php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-07 12:23 UTC] jan@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of jan
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=885f88f7eae8ffc3a083ed2edbf939992d762e22
Log: - fix #17806
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Sep 11 21:00:02 2025 UTC