diff options
author | Jose dos Santos Junior <j.s.junior@live.com> | 2018-12-12 05:19:14 +0000 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2018-12-12 05:19:14 +0000 |
commit | 996b63f50d183de87b220aa756515e7196c98565 (patch) | |
tree | bb0de3e0272c1618ba489446a69e9e43adc9c618 /mini_httpd.c | |
parent | 8c9d76a92c0ed7a0734c849f83233125f2575457 (diff) |
mini_httpd does not run php cgi
shows following error: "No input file specified".
===================================================================
Gbp-Pq: Name 03-cgi-php
Diffstat (limited to 'mini_httpd.c')
-rw-r--r-- | mini_httpd.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 ); |