1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Debian QA Group <packages@qa.debian.org>
Date: Fri, 12 Jul 2019 01:06:21 +0000
Subject: mini_httpd does not run php cgi
shows following error: "No input file specified".
===================================================================
---
mini_httpd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mini_httpd.c b/mini_httpd.c
index 1218dd0..ef06d36 100644
--- a/mini_httpd.c
+++ b/mini_httpd.c
@@ -1150,7 +1150,7 @@ handle_request( void )
int r, file_len, i;
const char* index_names[] = {
"index.html", "index.mini-httpd.html", "index.htm", "index.xhtml", "index.xht", "Default.htm",
- "index.cgi" };
+ "index.cgi", "index.php" };
/* Set up the timeout for reading. */
#ifdef HAVE_SIGSET
@@ -2240,6 +2240,7 @@ make_envp( void )
int envn;
char* cp;
char buf[256];
+ char rp[MAXPATHLEN];
envn = 0;
envp[envn++] = build_env( "PATH=%s", CGI_PATH );
@@ -2260,6 +2261,7 @@ make_envp( void )
envp[envn++] = build_env(
"REQUEST_METHOD=%s", get_method_str( method ) );
envp[envn++] = build_env( "SCRIPT_NAME=%s", path );
+ envp[envn++] = build_env( "SCRIPT_FILENAME=%s", realpath(file, rp) );
if ( pathinfo != (char*) 0 )
{
envp[envn++] = build_env( "PATH_INFO=/%s", pathinfo );
|