POV-Ray : Newsgroups : povray.off-topic : Just ask Google : Re: Just ask Google Server Time
29 Jul 2024 08:16:49 EDT (-0400)
  Re: Just ask Google  
From: Invisible
Date: 19 Jul 2012 04:36:01
Message: <5007c6f1$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.