Description: mini_httpd does not run php cgi
	       shows following error: "No input file specified".
	       Thanks to Thorsten Schmale who has written this patch.
Author: Marvin Stark <marv@der-marv.de>
Last-Update: 2015-09-03
Index: mini-httpd-1.21/mini_httpd.c
===================================================================
--- mini-httpd-1.21.orig/mini_httpd.c
+++ mini-httpd-1.21/mini_httpd.c
@@ -1141,7 +1141,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
@@ -2147,6 +2147,7 @@ make_envp( void )
     int envn;
     char* cp;
     char buf[256];
+    char rp[MAXPATHLEN];
 
     envn = 0;
     envp[envn++] = build_env( "PATH=%s", CGI_PATH );
@@ -2167,6 +2168,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 );
