PHP Script Can't Create Log File

I moved my web site from another web hosting company to a Linode Ubuntu account.

My site had some PHP scripts that created log files to output trace messages I use in troubleshooting the scripts.

Now that I am on linode, my PHP scripts can't create the log files.

Anything I need to do, perhaps in Apache or PHP to get this to work again?

I have a Linode 512 with LAMP stack StackScript.

Thanks!

Greg

4 Replies

Your problem isn't related to Linode.

Try http://stackoverflow.com to ask this kind of questions.

Don't forget to write full description - error message and related part of code.

I'd bet it's permissions, assuming you're using the default php installation of mod_php with apache prefork then you're php files will be running under the www-data user, make sure the www-data user has write access to wherever you're logs are written to.

Thanks for the replies. I guess I have some more to learn about Apache to solve this.

Like obs said, it's probably a permissions error. Try running:

sudo chmod 775 /path/to/the/directory/
sudo chown www-data:www-data /path/to/the/directory/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct