I have a PHP script involving exec() that will run fine from the command line but not in a web context. The script is simply this:
<?php exec('echo "wee" > /home/jason/wee.txt');
If I call this script wee.php and run php wee.php, it works fine and wee.txt gets written.
If I go to http://mysite.com/wee.php, the script pretends to run fine but wee.txt doesn't actually get written.
Any idea why this is happening?