LoginSignup
21
30

More than 3 years have passed since last update.

PHPのerror_logの出力先はどこ?

Posted at

はじめに

普段、何気なく使用しているerror_log

エラーログの出力先はこちら。(確認コマンドとともに)

tail -f /var/log/php/php.log

「このエラーログの出力先はどこで設定しているの?」
と疑問に思ったので、あらためて調べてメモ。

そもそもphp.iniはどこ?

エラーログの出力先はphp.iniにかかれているようですが、そもそもphp.iniはどこにあるのかわからなかったので、その確認方法。

phpinfo()に書かれるみたいなので、便利な確認コマンドがあった。

php -r "echo phpinfo();" | grep "php.ini"

参照:https://qiita.com/ritukiii/items/624eb475b85e28613a70

出力結果
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

ふむふむ、/etc/php.iniにありますのね〜

php.iniの設定を確認

下記コマンドで確認

cat /etc/php.ini | grep error_log
出力結果
error_log = /var/log/php/php.log

おお、ここで設定されているようでした。

21
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
30