I hope this question makes sense - it might be that I don't fully understand what is going on.. but after a considerable amount of googling to no avail here goes:
What I'm trying to do is execute a PHP file on the command line using php filename.php and get the output as HTML - so it could be displayed as a webpage. Currently the command line is just returning raw text output with no HTML tags. Currently the only line of code in PHP file is: <?php phpinfo() ?>
Is this possible? If not, how does MAMP etc execute that file to produce a HTML output?
Thanks!
If you use php-cgi instead of php from the CLI your program will run as if it were running on a webserver. It won't have access to anything in $_SERVER, $_POST, $_GET etc but it will cause phpinfo() to produce HTML instead of plain text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With