cgi error

After a restart of server 2003 I get the following error:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers.

None of my CGI applications are working
I am using fast cgi

Any ideas please
doctorbillTechAsked:
Who is Participating?
 
FishMongerConnect With a Mentor Commented:
I've never used sharepoint, so I can't give a definitive answer.  But as long as it doesn't depend on any IIS specific features and adheres to the http/html standards, then I don't see any reason why it wouldn't work under apache.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Have you checked to see if the Perl and PHP interpreters are set up in IIS?  It was working before the restart?  Can you show us simple examples of scripts that are not working?  

I have a number of Perl scripts that used to give me that message that I had to fix.  They at least have to return a "Content-type: text/html" header before the content.
0
 
doctorbillTechAuthor Commented:
everything was fine before the restart now all scripts are giving me this error so it must be a problem from a common source
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
doctorbillTechAuthor Commented:
This is my config set up in IIS:

Home directory tab - Configuration:
C:\Perl\bin\perl.exe "%s" %s
0
 
doctorbillTechAuthor Commented:
I am pretty sure there is a conflict between the perl  interpreter and some other service
Do you have any ideas please
0
 
doctorbillTechAuthor Commented:
Can you please tell me how the perl / cgi actually works on a web page to help me solve this issue
0
 
doctorbillTechAuthor Commented:
The cgi application I am using is c:\php\php-cgi.exe
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
I have Perl setup the same way you do except I'm on XP with IIS 5.1 and I'm using PHP thru the 'PHP5isapi.dll' module.  As far as I know, there is no interaction between Perl cgi and PHP cgi in IIS.  Although 'cgi' is used to refer to both, they are completely separate and 'fast cgi' refers only to PHP.  I've never seen that error message for PHP, only for Perl.
0
 
doctorbillTechAuthor Commented:
Sorry - to clarify:
The program I am using for the .php extension is c:\php\php-cgi.exe
NONE of my php sites are working
They ALL give the above CGI error

I have restarted IIS many times, started the server with all services except microsoft dissabled etc - no improvement
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Where are you seeing that error?
0
 
FishMongerConnect With a Mentor Commented:
0
 
doctorbillTechAuthor Commented:
In every page which has the php extension

More info:
About your previous comment:

If I use the following url:
http://localhost/cgi-bin/helloworld.pl

I get the correct response:

Hello World!

You have reached http://localhost

Your IP Address is 127.0.0.1

Have a nice day!

Why is the .php extension trying to start perl or giving a perl error ?
0
 
FishMongerConnect With a Mentor Commented:
The error message you're receiving is a standard http error.  It's not specific to perl or php.  It simply means that the script did not output any http headers.

Either php is not configured correctly or IIS is not configured correctly to run php fast cgi scripts.

BTW, fast cgi is also available for perl, it's not just php.

Based on the output you received from http://localhost/cgi-bin/helloworld.pl, it's clear that your perl cgi scripts are working correctly.
0
 
doctorbillTechAuthor Commented:
Any ideas what is happening with php ?
0
 
doctorbillTechAuthor Commented:
If I use the following (same server system but using apache server)  it works fine:
http://localhost:888/ticktockreminders/reminder_list.php

If I use the follwing (using same server system but IIS):
http://localhost/ticktockreminders/reminder_list.php

I get the cgi error

Looks like it is IIS specific
0
 
FishMongerConnect With a Mentor Commented:
I prefer to use perl and apache and I haven't used IIS since 2000 and have limited experience with php, so my help here may be limited.

Have you checked the error logs for both php and IIS to see if they give more details?

Are you able to run standard php scripts via php.exe instead of php-cgi.exe?

Do you get any error messages when you run php -i from the command line?

I'm not sure but php-cgi may take the same option parameter, so give it a try from the command line to see if you get any errors.

Post any/all output you receive from those commands; it may help us to help you.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
On my system that has both IIS and Apache, I can not run them both on the same IP address although I have never tried running them both on 'localhost'.  And when I run them on their own separate IP addresses, they do not respond to 'localhost'.
0
 
doctorbillTechAuthor Commented:
If I use the command prompt:

c:\php\php-cgi.exe c:\inetpub\wwwroot\phpinfo.php

The output works fine and I get all the php nformation
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Running it on the command line does not involve either web server.  Also... IIS and Apache require two different versions of PHP.  IIS requires the NTS Non-Thread Safe version and Apache requires the TS Thread Safe version.  If you have only one version of PHP then either Apache or IIS is going to have a problem.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Here's the download page for PHP for Windows: http://windows.php.net/download/  If you are using an older version, there is a link at the bottom of the left column for the Archive page.
0
 
FishMongerConnect With a Mentor Commented:
On my system that has both IIS and Apache, I can not run them both on the same IP address
Dave, as long as they are listening on separate ports, you'll be able to run them simultaneously and with the same IP.  You just need to specify the port in the url if it's not listening on port 80.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
You're right.  IIS does hog port 80 no matter what other IP address you might want to use.
0
 
doctorbillTechAuthor Commented:
Recap:

1. There is nothing wrong with the PHP installation  and IIS /  Apache installs on the same server - they have been working fine together on this server for years
 
2. it looks as if it is SPECIFIC TO IIS

any ideas please
0
 
FishMongerConnect With a Mentor Commented:
If it's been working for years and just started to fail, then you need to ask yourself (and others that may have access to the server) what recent changes have been made to the server.

Was PHP upgraded or its config altered?

Was IIS upgraded or its config altered?

Were any OS updates/patches applied?
0
 
doctorbillTechAuthor Commented:
No alterations at all on the system

Also:
http://localhost/phpinfo.php

This works then doesn't work and gives the error

Random behaviour
0
 
FishMongerConnect With a Mentor Commented:
That tell me that there's probably a conflict in the config and runs somtimes under php-cgi.exe and sometimes under php.exe and one of those is misconfigured causing it to fail.
0
 
FishMongerConnect With a Mentor Commented:
If I were managing the server, I'd switch everything over to Apache, especially since it's already been confirmed that it is correctly running both perl and php scripts.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Good luck.  I'm out.
0
 
doctorbillTechAuthor Commented:
If I switch to apache Is it possible to run iis webapps such as sharepoint undrr apache
0
 
doctorbillTechAuthor Commented:
not solved but food for thought
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.