Well, if you start a shell script from php it will be executed under the same user that the webserver is running under. And that user obviously doesn't have read-write permissions in your directory. If you really aren't concerned about security problems you can change the permissions on the directory to allow anyone read-write access:
chmod 777 directoryname
This is, of course, highly undesirable as your data would be completely unprotected from malicious users.
If you don't have shell access you may be able to issue this command via ftp.
In the end, the best way to deal with this is just as TruckStuff said. Give the user that the webserver runs under write permissions to the directory. Ask the server admin to do this for you.