php.net |  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
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: 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:
#!/usr/local/bin/php
<? 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.

Patches

Pull Requests

History

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 http://www.php.net/manual/configuration05.php3 and scroll down to the bottom and read "Case 4"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC