Problem making system calls with PHP scripts
Posted
by mazin k.
on Super User
See other posts from Super User
or by mazin k.
Published on 2010-03-08T00:16:27Z
Indexed on
2010/03/08
3:32 UTC
Read the original article
Hit count: 847
php
I have the following PHP script:
<?php
$fortune = `fortune`;
echo $fortune;
?>
but the output is simply blank (no visible errors thrown).
However, if I run php -a
, it works:
php > echo `fortune`;
Be careful of reading health books, you might die of a misprint.
-- Mark Twain
php >
Am I missing a config directive or something that would cause this?
Edit: So, I tried running my script using $ php-cgi fortunetest.php
and it worked as expected. Maybe the issue is with Apache2?
© Super User or respective owner