0

I have tried two different things on my server:

    • created a directory php in /var/log/
    • changed owner:group to www-data:www-data (apache owner)
    • changed permissions of the directory to 775
    • php.ini has error_log = "/var/log/php/php.log"
    • php.ini already had error logging set to on, and error reporting set to all
    • restarted apache
  1. in the code, changed error_log('message') to error_log('message',3,path_to_logfile)

Neither results in messages in the applicable log file.

6
  • Did you try this as an owner or a normal user ? Commented Oct 5, 2013 at 3:19
  • Not sure I understand your question fully. If 'this' is the steps above, it was as root. If running the code, it's via the web with a browser, so not really applicable? Commented Oct 5, 2013 at 3:37
  • check its the right php.ini file you edited. gone and edited the wrong copy on many occasions Commented Oct 5, 2013 at 3:53
  • yeah, me too, but there are are only 2 on the server, /etc/php5/apache2 and /etc/php/cli, and I edited the former. Commented Oct 5, 2013 at 4:01
  • When you type, php -r "phpinfo();" on your command line, or call up the phpinfo page, where does it say the logging is going? Commented Oct 5, 2013 at 4:07

1 Answer 1

1

You say you created /var/log, but you're trying to write to /var/log/php. Try creating a directory called php in /var/log.

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

3 Comments

I think I said I created php IN /var/log (ie /var/log/php) :-)
But even when I just go with error_log = syslog in the php.ini file, or use error_log with value 3 and a specified file, error_log statements in php go nowhere.
Ah, yes. I misread your for bullet point. Sorry about that. I'm not sure why you wouldn't be getting any log entries. Could be some odd issue between your OS version and PHP version.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.