http://qs321.pair.com?node_id=639731


in reply to System and CGI - File Created but not the Content (Similar Situation)

You might not have permission to write to the file.

The system call to chmod swallows up any error messages, and will not report the output to any error log. You are better off using the perl chmod command because it will complain when it has trouble.

It is feasible that your code could create a file to which it can not write. You need to check not only the resulting permissions on the file, but the immediate parent directory as well, assuming it exists.

UPDATE: What I mean is that you might have all the permissions turned on, but the wrong user owns the file. It looks like due-diligence on your part, so I'm just throwing stuff out there.

  • Comment on Re: System and CGI - File Created but not the Content (Similar Situation)

Replies are listed 'Best First'.
Re^2: System and CGI - File Created but not the Content (Similar Situation)
by holandes777 (Scribe) on Sep 23, 2007 at 14:31 UTC
    Checked all permissions. The apache configuration has apache as the user that executes and the file is 666 and owned by apache when it is finished. The parent and its parent are 777 (also owned by apache). Error logs are empty of any references to this. That's why I don't get it. I'll try the perl chmod suggestion to see if I get error reporting and let you know.
    I am presuming that the configured user for apache (called apache) is what is running the script.