0

I've create a small php application with log4php on my work desktop machine running windows 7 and net. it works fine, daily file it's been created and log are in.

NOw i'm on my laptop running ubuntu 11,04. i originally gave persmission 755 to the folder Integrator (name of the app) and subfolder under /var/www/Ingrator.after realizing this

Mon May 16 18:03:44 2011] [error] [client 127.0.0.1] PHP Warning: fopen(./logs/daily_20110516.log): failed to open stream: Permission denied in /var/www/Integrator/lib/log4php/appenders/LoggerAppenderFile.php on line 77

permission issue in the apache log, i've changed the owner to be the current owner, but this. it gives the same error.now it's even with the permission 777. it's still persistent. So i'm a little surprise.how can i fix that? thanks for reading this.

3
  • What is the absolute path where your logs directory is in? Commented May 16, 2011 at 19:12
  • the user that runs the script should have the permissions set to 7 and added as the file owner group. chown root:newUser fileName and chmod 775 Commented May 16, 2011 at 19:13
  • Hey phil thanks for you input.right now the file permission is 777 for all of them.can you elaborate a bit what you are suggesting? Commented May 16, 2011 at 19:16

1 Answer 1

2

The error says it's trying to open the file, which means that the Apache user doesn't have permission to the file. Basically, it can open the folder and see that the file is there, but can't do anything with it, because permissions for folders are separate from permissions for files.

Make sure the file is owned by www-data, in the www-data group, or has read/write permissions that www-data can use (assuming you left the Apache user as www-data, if not, use the Apache user you've set).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.