Well, it could not have worked at that time, because fen2.cgi was not looking at its arguments at all. It expected the query string in an environment variable, which is how Apache passes it. Another problem was that the query string can contain &, which in the eyes of the shell terminates the command. I now escaped that with a backslash when fen2.php glues the string back to one piece. Yet another problem was that the PHP script always seems to put out a header, even when the header("image/png") call was commented out: it then uses a default header "text/plain", possibly inserting it before the header emitted by fen2.cgi. So it was imperative that the PHP script would set the header to "image/png", and hence that fen2.cgi would omit the header, as that would then be perceived as corrupted PNG data.
I believe I also was fooled a lot by browser caching, as displaying a queen suddenly started working without me making a significant change.
Well, it could not have worked at that time, because fen2.cgi was not looking at its arguments at all. It expected the query string in an environment variable, which is how Apache passes it. Another problem was that the query string can contain &, which in the eyes of the shell terminates the command. I now escaped that with a backslash when fen2.php glues the string back to one piece. Yet another problem was that the PHP script always seems to put out a header, even when the header("image/png") call was commented out: it then uses a default header "text/plain", possibly inserting it before the header emitted by fen2.cgi. So it was imperative that the PHP script would set the header to "image/png", and hence that fen2.cgi would omit the header, as that would then be perceived as corrupted PNG data.
I believe I also was fooled a lot by browser caching, as displaying a queen suddenly started working without me making a significant change.
Anyway, it does appear to work now!