At 10:48 AM -0400 09-15-2000, lkeeton wrote:
>*****Here is my script in perl
>$variable = `mysqldump -u galaxy -p galaxy > "backup.txt"`;
>Here is the result from the error_log
>sh: backup.txt: Permission denied
>*****This is how it works on the command prompt or unix shell
>mysqldump -u galaxy -p galaxy > "backup.txt"
>Password: password hit enter
>It works and generates the txt file
It's actually not a mysqldump problem. The error message is prefixed
with "sh:", which tells you that the shell is complaining, not mysqldump.
The problem is that the Web server doesn't have the same file system
privleges that you do. When you run the command from the shell yourself,
you're generating an output file in (presumably) your own directory,
so you have permission to do that.
When the Web server runs the script, it's running as some other user
ID (perhaps "nobody"), and apparently doesn't have permission to write
files in the document tree (a restriction that is normally a good
security practice). You might want to change your script to write
into /tmp/backup.txt or something.
Paul DuBois, paul@stripped