|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #372 Magic #! scripts fails as CGI
Submitted: 1998-05-12 12:02 UTC Modified: 1998-05-23 17:59 UTC
From: ryde at tripnet dot se Assigned: rasmus (profile)
Status: Closed Package: Other
PHP Version: 3.0 Release Candidate 4 OS: Debian GNU/Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: ryde at tripnet dot se
New email:
PHP Version: OS:


 [1998-05-12 12:02 UTC] ryde at tripnet dot se
When using php in script that begins with #! it fails as CGI 
but works from the commandline. A simpe script:
<? echo "Hello\n"; ?>

Running this from the commandline happily prints "Hello".
But when using this as a CGI it gives "No input file 
specified." (the first one in main.c).

I try this on Apache 1.2.6 webserver.

I mainly make most of my cgi scripts this way, partly to avoid 
some of the security issues by putting the main parserbinary 
in the cgi-bin directory.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-23 17:59 UTC] rasmus
If you want to run CGI's this way you need to compile PHP with --enable-discard-path.
See and scroll down to the bottom and read "Case 4"
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 20 20:03:44 2023 UTC