| | |
CGI with C++. my cgi script in perl works perfectly but not c++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Solved Threads: 0
Apache Web server for windows
I wrote a helloworld.pl and that works fine when i try to view it through a webbrowser.
I then wrote the following:
#include <iostream>
using namespace std;
int main()
{
cout << "Content-type: text/plain" << endl << endl
<< "Hello, World!";
return 0;
}
compiled using g++ (cygwin).
when run through command prompt i get:
Content-type: text/plain
Hello, World!
when i try to open http://localhost/cgi-bin/hello.exe:
i get 500 Internal Server Error.
when looking through the error log, the only error there is:
[Sat Nov 20 13:38:16 2004] [error] [client 127.0.0.1] Premature end of script headers: hello.exe
Can anyone please help me out?
I wrote a helloworld.pl and that works fine when i try to view it through a webbrowser.
I then wrote the following:
#include <iostream>
using namespace std;
int main()
{
cout << "Content-type: text/plain" << endl << endl
<< "Hello, World!";
return 0;
}
compiled using g++ (cygwin).
when run through command prompt i get:
Content-type: text/plain
Hello, World!
when i try to open http://localhost/cgi-bin/hello.exe:
i get 500 Internal Server Error.
when looking through the error log, the only error there is:
[Sat Nov 20 13:38:16 2004] [error] [client 127.0.0.1] Premature end of script headers: hello.exe
Can anyone please help me out?
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Solved Threads: 0
oh yea. forgot. this is the ScriptLog:
%% [Sat Nov 20 23:41:24 2004] GET /cgi-bin/hello.exe HTTP/1.1
%% 500 C:/Program Files/Apache Group/Apache2/cgi-bin/hello.exe
%request
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: CFID=1700; CFTOKEN=34656032
%response
%% [Sat Nov 20 23:41:24 2004] GET /cgi-bin/hello.exe HTTP/1.1
%% 500 C:/Program Files/Apache Group/Apache2/cgi-bin/hello.exe
%request
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: CFID=1700; CFTOKEN=34656032
%response
•
•
Join Date: Nov 2004
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by kuo1
Apache Web server for windows
I wrote a helloworld.pl and that works fine when i try to view it through a webbrowser.
I then wrote the following:
#include <iostream>
using namespace std;
int main()
{
cout << "Content-type: text/plain" << endl << endl
<< "Hello, World!";
return 0;
}
compiled using g++ (cygwin).
when run through command prompt i get:
Content-type: text/plain
Hello, World!
when i try to open http://localhost/cgi-bin/hello.exe:
i get 500 Internal Server Error.
when looking through the error log, the only error there is:
[Sat Nov 20 13:38:16 2004] [error] [client 127.0.0.1] Premature end of script headers: hello.exe
Can anyone please help me out?
did u tried making a html file...by copyin in a virtual directory...make an html file nd call frm there this file...with get action method....r probably u hav not used header...try print header...and it will work...
![]() |
Similar Threads
- PHP Formula and syntax (PHP)
- prototype successive ajax.updater requests fail on Windows only (JavaScript / DHTML / AJAX)
- running Perl/CGI scripts under Tomcat server (Perl)
- Form Submit Problems (Site Layout and Usability)
Other Threads in the C++ Forum
- Previous Thread: Function with pointer?
- Next Thread: Logic to Convert Days From 1800 to a Date (Month, Day, Year)
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





