I have a simple problem that has me confused. I'm trying to write to a file using PHP fopen but I'm getting the error
"Warning: fopen(/var/www/********/file.php): failed to open stream: Permission denied in /var/www/********/index.php on line 339
The file (and directory) that I am trying to write to (file.php) has 777 permissions and is chowned to same user as index.php.
Any ideas what the problem could be?