|
![](/i/fill.gif) |
On 17/07/2012 09:03 AM, Invisible wrote:
> - Finding a web hosting company that allows arbitrary CGI /binaries/ is
> seemingly impossible.
Apparently my /current/ web host offers arbitrary CGI using PHP. (And a
MySQL database, if I want one.)
According to the manual, any file ending *.php4 or *.php5 is considered
to be a PHP file. Anything ending *.cgi is assumed to be a CGI script.
(I think it supports one other language - maybe Perl.)
First attempt: Write a small C program, compile it on Linux, upload it
to the server, name it HelloWorld.cgi, try to access it.
Oh dears: HTTP 500. No way of accessing the logs to find out what failed.
Second attempt: PHP apparently contains a passthru() function which lets
you run an arbitrary command and pipe its output to the HTTP client. So
if I just run ./HelloWorld.cgi, I'm golden.
No good. Statements before passthru() execute fine. Statements after
passthru() execute fine. passthru() itself appears to generate no
output. Again, this is a scripting language, so there's no way of
knowing why it failed.
I know for a fact that my host runs Linux, and the web server is Apache.
It seems a reasonable assumption that it's AMD64, but the documentation
does not specify. Nor does it state which Linux distro. I had hoped that
PHP might offer some function to query this information... but no, it
doesn't.
If I scheme hard enough, perhaps I can trick my existing web host into
doing what I actually want, without having to upgrade to their dedicated
server product at 15x the price...
Post a reply to this message
|
![](/i/fill.gif) |