I'm having a hard time putting the output from an executable on my web server into a web page. I'm hoping to get a simple "Hello World" going.
Specifically, I have a very basic C program that prints "Hello World". I've compiled it using gcc, which produces HelloWorld.out, which I can run from the command line.
I then have a basic index.php file, in which I am attempting to use passthru() to output the result of the C program into the web page. The .php file looks like:
<?php passthru('HelloWorld.out'); ?>
I've uploaded both the php and the .out file to the same directory on my server. However, index.php produces no output. I've looked around online and there's a few places I may be getting this wrong... My general goal is to be able to embed the output from an executable program on my web server into the page (doesn't need to be HelloWorld.out; possibly the .out extension doesn't work on the server?). Or I may be using passthru() incorrectly; as I understand this is the most barebones was to use it.
Thanks!
passthrureturn nothing, so you obviously have no output on the page?void passthru ( string $command [, int &$return_var ] )php.net/manual/en/function.passthru.php Or am I missing something?