How to setup D language with Apache httpd cgi?

BoQsc vaidas.boqsc at gmail.com
Wed Jul 31 07:19:12 UTC 2019


There are some other bad news, I switched from rdmd to dub 
package manager since I need a package from Adam D. Ruppe.

It is all good and well: this one works perfectly.
>#!/usr/bin/env dub
>/+ dub.sdl:
>	name "hello"
>	
>+/
>import std.stdio;
>void main()
>{
>    writeln(`Content-type: text/html`);
>    writeln(``);
>    writeln(`<body style="background: lightgreen">CGI D 
> Example</body>`);
>
>
}


But, once I add dub dependency, the error appears: Internal 
Server Error
>#!/usr/bin/env dub
>/+ dub.sdl:
>	name "hello"
> 	dependency "arsd-official" version="~>4.0.1"
>	
>+/
>import std.stdio;
>void main()
>{
>    writeln(`Content-type: text/html`);
>    writeln(``);
>    writeln(`<body style="background: lightgreen">CGI D 
> Example</body>`);
>
>
}

This seems to work well when running not from cgi, so there is no 
syntax error.


More information about the Digitalmars-d-learn mailing list