joswa / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

PHP CGI in Subfolder not working #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Tryied on Windows 7, php-cli.exe was in a relative folder "php"
2. CGI was not working.

I Used Mongoose 3

To solfe the Problem I had to change the line

  if (CreateProcessA(NULL, cmdline, NULL, NULL, TRUE,
        CREATE_NEW_PROCESS_GROUP, envblk, dir, &si, &pi) == 0) {

to

  if (CreateProcessA(NULL, cmdline, NULL, NULL, TRUE,
        CREATE_NEW_PROCESS_GROUP, envblk, NULL, &si, &pi) == 0) {

I think "dir" is wrong.

I get an error "No input file specified." from PHP.

Original issue reported on code.google.com by andreasb...@gmail.com on 11 Jun 2011 at 3:12

GoogleCodeExporter commented 9 years ago
I think it's the same issue as 136 and 242.

Original comment by lieven.r...@gmail.com on 29 Jul 2011 at 6:17

GoogleCodeExporter commented 9 years ago
i also had this problem on windows, but i replace the "dir" with "." .

Original comment by gewal...@gmail.com on 15 Aug 2011 at 7:00

GoogleCodeExporter commented 9 years ago
CGI standard says that web server must start CGI program in the directory where 
CGI program lives, i.e. program's CWD (current working directory) must be set 
to the program's directory.
Therefore, you're fix is wrong.
If you keep in mind that the CGI is started in it's own dir, it would be easy 
to understand how to call CGI interpreter using relative path, e.g.
#!../../bin/my_php.exe

Original comment by valenok on 5 Feb 2012 at 5:18