digitalmars.D.learn - (no subject)
- new to d (1/1) Jun 06 2010 After reading on this newsgroup about the use of D with cgi i've tried i...
- new to d (2/3) Jun 06 2010 I forgot the subject in my previous post, sorry.
- Graham Fawcett (5/13) Jun 06 2010 I would start by reading the output in your Web server's error_log.
- Robert Clipsham (4/9) Jun 06 2010 Could you show us your hello world code and tell us how you're compiling...
- new to d (8/19) Jun 06 2010 It's a typical hello world program:
- Robert Clipsham (4/10) Jun 06 2010 And how are you interfacing each app with cgi? There could be some
- new to d (4/18) Jun 06 2010 It works now after i added
- new to d (2/24) Jun 06 2010 And I guess this should really be writeln("Content-Type: text/plain;char...
- Michal Minich (4/10) Jun 06 2010 Just a guess, but maybe the difference of your C and D programs is in
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (6/18) Jun 06 2010 It should be ok. If there is no return statement, a D program returns 0
After reading on this newsgroup about the use of D with cgi i've tried it on my host. Even a simple hello world program gives me internal server error while equivalent c program compiled with gcc works fine. Does any one here have any idea what the problem could be?
Jun 06 2010
new to d Wrote:After reading on this newsgroup about the use of D with cgi i've tried it on my host. Even a simple hello world program gives me internal server error while equivalent c program compiled with gcc works fine. Does any one here have any idea what the problem could be?I forgot the subject in my previous post, sorry.
Jun 06 2010
On Sun, 06 Jun 2010 08:42:22 -0400, new to d wrote:new to d Wrote:I would start by reading the output in your Web server's error_log. Internal Server Error just means 'something went wrong' -- the details are in your error log. GrahamAfter reading on this newsgroup about the use of D with cgi i've tried it on my host. Even a simple hello world program gives me internal server error while equivalent c program compiled with gcc works fine. Does any one here have any idea what the problem could be?I forgot the subject in my previous post, sorry.
Jun 06 2010
On 06/06/10 13:40, new to d wrote:After reading on this newsgroup about the use of D with cgi i've tried it on my host. Even a simple hello world program gives me internal server error while equivalent c program compiled with gcc works fine. Does any one here have any idea what the problem could be?Could you show us your hello world code and tell us how you're compiling etc? Without more details it's hard to say what's going wrong. Robert
Jun 06 2010
Robert Clipsham Wrote:On 06/06/10 13:40, new to d wrote:It's a typical hello world program: import std.stdio; void main(string[] args) { writeln("Hello world!"); } I also tried using printf instead of writeln. I'm compiling it with dmd test.d. I'm using dmd v2.046. I'm compiling the c program with gcc -otest2 test2.c.After reading on this newsgroup about the use of D with cgi i've tried it on my host. Even a simple hello world program gives me internal server error while equivalent c program compiled with gcc works fine. Does any one here have any idea what the problem could be?Could you show us your hello world code and tell us how you're compiling etc? Without more details it's hard to say what's going wrong. Robert
Jun 06 2010
On 06/06/10 14:00, new to d wrote:It's a typical hello world program: import std.stdio; void main(string[] args) { writeln("Hello world!"); } I also tried using printf instead of writeln. I'm compiling it with dmd test.d. I'm using dmd v2.046. I'm compiling the c program with gcc -otest2 test2.c.And how are you interfacing each app with cgi? There could be some subtle difference there which is doing it, that app on its own looks fine and works here.
Jun 06 2010
Robert Clipsham Wrote:On 06/06/10 14:00, new to d wrote:It works now after i added writeln("Content-Type: text/plain;charset=us-ascii\n\n"); I didn't know this is required, i have never used CGI before. I copied c example from some cgi tutorial and forgot to include that line in the D program. I'm sorry for wasting your time.It's a typical hello world program: import std.stdio; void main(string[] args) { writeln("Hello world!"); } I also tried using printf instead of writeln. I'm compiling it with dmd test.d. I'm using dmd v2.046. I'm compiling the c program with gcc -otest2 test2.c.And how are you interfacing each app with cgi? There could be some subtle difference there which is doing it, that app on its own looks fine and works here.
Jun 06 2010
new to d Wrote:Robert Clipsham Wrote:And I guess this should really be writeln("Content-Type: text/plain;charset=utf-8\n\n") for D.On 06/06/10 14:00, new to d wrote:It works now after i added writeln("Content-Type: text/plain;charset=us-ascii\n\n"); I didn't know this is required, i have never used CGI before. I copied c example from some cgi tutorial and forgot to include that line in the D program. I'm sorry for wasting your time.It's a typical hello world program: import std.stdio; void main(string[] args) { writeln("Hello world!"); } I also tried using printf instead of writeln. I'm compiling it with dmd test.d. I'm using dmd v2.046. I'm compiling the c program with gcc -otest2 test2.c.And how are you interfacing each app with cgi? There could be some subtle difference there which is doing it, that app on its own looks fine and works here.
Jun 06 2010
On Sun, 06 Jun 2010 09:00:25 -0400, new to d wrote:import std.stdio; void main(string[] args) { writeln("Hello world!"); }Just a guess, but maybe the difference of your C and D programs is in return value, which can be differently interpreted by CGI host. try returning 1 or 0 from the program.
Jun 06 2010
Michal Minich wrote:On Sun, 06 Jun 2010 09:00:25 -0400, new to d wrote:It should be ok. If there is no return statement, a D program returns 0 for successful exit, and non-zero for error. This point has been stressed in Andrei Alexandrescu's "The Case for D" article when comparing the "hello world" programs of some languages. Aliimport std.stdio; void main(string[] args) { writeln("Hello world!"); }Just a guess, but maybe the difference of your C and D programs is in return value, which can be differently interpreted by CGI host. try returning 1 or 0 from the program.
Jun 06 2010