1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
The cgiwrap wrapper is available to execute CGIs.
It has been deployed on our servers with an execution memory limit of 128 MB on the old console and 256 MB on the Web and Classic hostings. We use a version 4 of cgiwrap which has been modified to suit our needs.
To check in the event of error "Internal Server Error" / "CGIWrap Error: Script Execution Failed":
It is essential that CGIs begin with Content-Type followed by two CRLF (or at least two LF) before displaying the contents. This can be obtained by sending a "print" Content-Type: text/html followed by a second empty "print" or by using the back slash sequence twice followed by r and back slash followed by n.
The script must also have permission to execute, must belong to an administrator-type user for this hosting and must be transferred in ASCII mode, certainly not in binary mode.
Moreover in order for Python or Perl CGI to be recognised on our servers, they must be saved in Unix format (LF - back slash n) and in no event in the MS-Dos format (CRLF back slash r followed by back slash n or CR back slash r).
Here is an example in Perl:
<code>#!/usr/bin/perlprint "Content-type: text/html\r\n\r\n";print "Hello World";</code>
Furthermore, debugging messages sent on stderr, which can be found in error_log on a normal httpd installation, are merged with stdout. If they appear in the headers (before the double \n), httpd will send the client a 5xx error, the cause for which may vary a lot.