Hello all,

I've recently started my first bit of shell scripting and I really have hit a dead-end. I am trying to run a very simple shell script:-

Code:
 

#!/bin/sh
rawdomain=${1%%/*}
echo $rawdomain
echo "help"
wget $1
Now when I run this as a user it works fine and even when I su www-data it works great too.
The problem comes when I try to run this from a php script

Code:
$output = array();
echo exec('/home/scripts/test.sh www.eicar.org', $output);
print_r($output);
The script does not run at all and when I check my apache errors I've got
Code:
--20:17:58--  http://www.eicar.org/
           => `index.html.1'
Resolving www.eicar.org... 88.198.38.136
Connecting to www.eicar.org|88.198.38.136|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,887 (3.8K) [text/html]
index.html.1: Permission denied

Cannot write to `index.html.1' (Permission denied).
I'm really at the end of my tether now and would love some help to at least work out why I'm getting this error

Thanks

Dan