I am getting this issue and that i arrived at a deadlock, I'd try anything I have arrived at a deadend. My problem goes such as this:

I've got a Perl/CGI script placed on Fedora 9 machine running apache2, this script possess a config file which put into exactly the same directory, this config file has 777 permissions.

The script can't email the file. It may read but by no means could I recieve it to create into it. The file is possessed through the same user the apache is running. I authored a little PHP script to check and placed it within the same folder. The PHP script can see but can't email it.

I am so desperate here and I'm not sure how to start with problem, so any assistance to get me on the proper way could be appreciated.

EDIT: I'm able to open the apply for editing from command line it's apache who can't can get on

EDIT2: the folder hierarchy /var/www/cgi-bin/script
permissions are such as this
/var root 755
www root 755
cgi-bin root 755
script apache 755

EDIT: The issue is at selinux. I disabled it and also the script had accessibility file thank you for everybody led

Thanks ahead of time

Does apache run with a few selinux profile or similar that prevents it writing for the reason that directory?

The consumer apache most likely does not have permission to among the parent sites. It must have a minimum of execute permission in most from the sites up to your directory that consists of your file.

EDIT: Right, thinking about this can be a programming site, some code may be so as.

  1. Make use of the absolute road to the file to check, not the relative someone to make certain you are within the right directory.

  2. $! should print a "Permission Refused" error if it's permissions, are you able to print the issue with:

    open(FILE, ">/path/to/file/config.ini") die "Cannot open: $!" ... close(FILE)

Maybe another process includes a write lock to file for? Try lsof to determine who's holding it open.

Does your directory allow permission for that webserver to create files there?

I understand that the previous publish discussed this, but It bears repeating: When talking about an issue of the character it's useful to incorporate the appropriate code and also the creation of the exception. If the I/O operation fails, $! should retain the system error message, which may explain why the operation unsuccessful. Saying "it did not work" does not really provide us with anything to take.