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:
exec()
Noticed you are writing to /home/jason. Note that apache will be the one running this command (i.e. www-data user if using Ubunut or Debian). Does the process have the correect rights to write to that folder?