简体   繁体   中英

PHP not logging errors

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM