# Patch: No input file specified

- Thread: https://externals.io/message/2349
- Original archive: https://news-web.php.net/php.internals/2349
- Started by Zak Johnson on 2003-06-16T17:42:49+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #2349 — Zak Johnson — 2003-06-16T17:42:49+00:00

URL: https://externals.io/message/2349#2349

I run PHP via a simple-minded webserver which sets up some environment
variables and then calls my php scripts (which begin with a
"#!/usr/local/bin/php" line).  My scripts must handle all the headers,
including the HTTP status header.  My standard included file contains
"header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');", and other files may
emit a similar header with a different status code for redirection and
so forth.

Unfortunately, after upgrading to 4.3.2 I encountered two problems.
First, PHP was refusing to emit status headers for which the status code
was 200 even when explicity instructed to by the above `header()` call.
Second, while my scripts would run correctly at the command line, when
run via a web server I was getting a 404 status and the error message
"No input file specified."

I have created a patch to work around the above problems; it is a hack,
but restores my desired functionality if I also set "cgi.rfc2616_headers
= 1" in php.ini.  Please consider backing out rev 1.195 of
php4/sapi/cgi/cgi_main.c or adding a configuration directive to disable
its behaviour.  I'm not sure what the correct solution for the "No input
file specified" problem is; I'll try to look into it more if I have some
time next week, but this was my first peek at PHP's source.

-Zak
