CGI Debugging: 'No Input File specified'

Posted by jeff.griffiths on 2007-02-06 18:25
OS: Linux | Product: Komodo | tags: debugging komodo linux PHP

When I try to debug PHP using CGI Emulation, I get this error:

No input file specified.


This is because your PHP CGI interpreter has been compiled with cgi.force_redirect set to on for security reasons. We can fix this in Komodo by changing this setting in the copy of php.ini that Komodo uses:

- open the php.ini copy that Komodo is using:


- change the setting:

; cgi.force_redirect = 1


cgi.force_redirect = 0

Save the php.ini, then try debugging using CGI Emulation again.

Patrick.Hayes@s... | Fri, 2007-02-09 07:22

komodo 4.01 on ubuntu 6.10

I've set cgi.force_redirect to 0 on every php.ini on my system, yet I still get "no input file specified" every time I try to run the following script using cgi emulation:

$hr = "<HR>";
echo "$hr\n";

if (array_key_exists('foo', $_POST)) {
  print("_POST[foo]=:" . $_POST['foo'] . ":<BR>$hr\n");
} else if (array_key_exists('foo', $_GET)) {
  print("_GET[foo]=:" . $_GET['foo'] . ":<BR>$hr\n");
} else {
  print("no foo defined<BR>$hr\n");

echo $hr;

jeff.griffiths | Wed, 2007-02-28 16:25

This is because the Ubuntu PHP is set to discard the script file path and not set SCRIPT_FILENAME in the environment. I have yet to find a magic bullet for this issue when using Ubuntu's php build.

JeffG | Komodo IDE 4.0 | MacBook Pro OS X Intel / Ubuntu 6.10 i386

brice | Mon, 2007-07-23 20:56

I am having a similar experience under Archlinux (not Ubuntu) using Komodo 4.1.1, build 279677, platform linux-libcpp5-x86.

Regardless of the cgi.force_redirect setting, I get the 'No input file specified' message upon debugging with CGI Emulation. I see that the Debugger Configuration wizard sets cgi.force_redirect to 0 in its "copied" php.ini (along w/ the xdebug reference).

The only way I found around this issue was to manually set the SCRIPT_FILENAME as a CGI environment variable. Set this to the absolute path of the .php file to be debugged.

Screenshot: -

Does anyone have other ideas for a fix?


~ Brice

ActiveState Staff
Tue, 2007-07-24 13:32

Open up Komodo file:

At line 600, add another environment flag "SCRIPT_FILENAME" so it looks like:


Restart komodo and your CGI scripts should debug properly.


brice | Tue, 2007-07-24 18:35


Your fix worked perfectly. Thanks for the prompt response.

I assume this has made it's way into the beta -- which I look forward to participating in once I purchase the IDE. Komodo is, after all, a project worth supporting! ;)

~ Brice

osmosis | Mon, 2008-06-09 20:54

What else could be causing this? I've tried everything above with no luck.

Komodo 4.3 beta
PHP 5.2.5
Windows XP

The trial period ran out before I had a chance to test cgi debugging, so I installed the beta to extend my trial and finish testing things out...

ActiveState Staff
Tue, 2008-06-10 09:57

Can you try using Komodo 4.3.2 or the Komodo 4.4 beta:

If that does not fix the problem, we'll need some additional details like:
* where did you download PHP from
* how are performing the CGI debugging (through Komodo's Debug - F5 command)
* which interpreter is set in your PHP language preferences


osmosis | Tue, 2008-06-10 16:51

Thanks for the help Todd.

I'm using:

Komodo IDE, version 4.4.0-beta1, build 19400, platform win32-x86.
Built on Fri May 30 02:25:59 2008.

Web Developer Suite 2.0 which includes Apache 2.2 and PHP 5.2.5

Preferences, PHP Language:

Interpreter: c:\www\php5\php.exe
php.ini: c:\www\php5\debug

I also tested with c:\www\php5\php-cgi.exe and received the same results.

the debug\php.ini was created during installation of Komodo. It's the default php.ini with the following prepended from Komodo:

; xdebug config added by Komodo
cgi.force_redirect = 0

I verified that those parameters are commented out everywhere else in the php.ini file.

Choosing Debug -> Go/Continue:

I choose "Use the CGI interpreter"

I check "Simulate CGI Environment"

and I add the post values according to the debugging PHP tutorial / demo.

It works if I choose "Use the CLI interpreter", but then it doesn't allow me to specify the post variables.

The only thing I can think to add at this point (in case it helps) is a copy of the php.ini along with lists of extensions enabled in php.

troyt | Thu, 2008-06-12 12:48

It looks like doc_root setting in the php.ini bundled with Web Developer Suite 2.0 causes problems for the remote debugger. Comment out that line in c:\www\php5\debug\php.ini and it should work.

Thanks for bringing this to our attention! We'll create a bug for Komodo to handle this better and mention it in the release notes, but it's unlikely to be fixed in time for the 4.4 release.