473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

CGI Error after exec or system in Windows

Hi there,

i am trying to run php(4.3.4) on iis6 (W2k3 Server).

All works perfect except running external programs.

The command system (or exec) starts and works (tried it, and the command is
executed)
but the server returns: CGI Error, CGI-application misbehaved.....

This is the code:

$command="date /T >>c:\\temp\\log.txt";
system ($command);
system ($command);
The actual date is written into the logfile twice, as expected, but no
website is returned.
This cannot be a security problem ??? File is written!

The save code on save machine works perfect using Apache 2.
Any ideas?
Nov 7 '05 #1
3 1867
On Mon, 7 Nov 2005 14:11:33 +0100, "Alexander" <ab****@gmx.net> wrote:
i am trying to run php(4.3.4)
That's quite old.
on iis6 (W2k3 Server).

All works perfect except running external programs.

The command system (or exec) starts and works (tried it, and the command is
executed)
but the server returns: CGI Error, CGI-application misbehaved.....
What's the rest of the error? Doesn't that message also include the headers
that it did send?

Have you checked the error logs for more information?
This is the code:

$command="date /T >>c:\\temp\\log.txt";
system ($command);
system ($command);
The actual date is written into the logfile twice, as expected, but no
website is returned.
This cannot be a security problem ??? File is written!

The save code on save machine works perfect using Apache 2.


Running as CGI as well? Or a module?
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 7 '05 #2
>i am trying to run php(4.3.4) on iis6 (W2k3 Server).

All works perfect except running external programs.

The command system (or exec) starts and works (tried it, and the command is
executed)
but the server returns: CGI Error, CGI-application misbehaved.....

This is the code:

$command="date /T >>c:\\temp\\log.txt";
system ($command);
system ($command);


A CGI needs to return a content-type: header (possibly plus other
headers) followed by a blank line followed by the body. Where did
you output the headers?

Gordon L. Burditt
Nov 7 '05 #3
On Mon, 07 Nov 2005 20:03:08 -0000, go***********@burditt.org (Gordon Burditt)
wrote:
A CGI needs to return a content-type: header (possibly plus other
headers) followed by a blank line followed by the body. Where did
you output the headers?


Isn't the PHP CGI executable supposed to handle that for you? Could this imply
the OP is using the SAPI executable instead?
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 7 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jerry | last post by:
I've found a problem with exec, passthru, shell_exec & system. I'm trying to run the following exec("sort -r -n -k2,2 r1.txt > r2.txt") with r1.txt being a numeric file. The file looks like...
2
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
1
by: ajithrnair | last post by:
Hai I got the error "An unhandled exception of typ 'System.ArithmeticException' occurred in system.windows.darawing.dll Additional information: Overflow or underflow in the arithmeti operation....
4
by: Robert W. | last post by:
I reloaded a WinForms project in VStudio 2003 that has been working perfectly fine for months. Suddenly I'm getting strange reference errors AND I can no longer load any form in Designer view. ...
3
by: Gio | last post by:
Hi all, this is my problem: I need to "exec" the following command: C:\Programmi\Soft\soft.exe -v -d C:\dati\$nomefile C:\dati\pdf\$filename and i tried to execute it in php with (one of) the...
0
by: seth.northrop | last post by:
Hi, I'm in the process of developing a script in Windows where I need to use exec/system. Whenever I execute either, Windows spawns a command window which automatically disappears. Is there a...
1
by: abhas59 | last post by:
hi friends, I want to serialize a System.Windows.Documents.Paragraph and for this I have written the following code in the application : mypara cust = new mypara(); Paragraph ph...
5
by: PeteOlcott | last post by:
I am getting compile time errors from the following line: using namespace System::Windows::Forms; Error 1 error C3083: 'Windows': the symbol to the left of a '::' must be a type Error 2 ...
2
by: Richard Ballin | last post by:
Hello All, I am taking a class using Visual Studio C++ Express 2010 and on one of the first projects i need to use the Math::Pow() function. The book does not do a good job of explaining how to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.