1.error_log($message,$message_type,$destination,$extra_headers)函數,
2.message_type 是0,發送信息到php.ini配置的error_log的位置
cli環境下是這里:/etc/php/7.0/cli/php.ini
fpm環境下是:/etc/php/7.0/fpm/pool.d/www.conf php_admin_value[error_log] = /var/log/php_errors.log 注意這個文件的權限和php-fpm用戶的運行
4.message_type 是1:
error_log("xxxx!", 1,"630892807@qq.com");//直接發送到郵箱,需要配置postfix和php.ini的sendmail
直接包安裝postfix和配置cli和fpm下的sendmail部分
3.message_type 是3就發送到第三個參數指定的文件中
4.message_type 是4直接發送到 SAPI 的日志處理程序中,比如返回給了nginx,可以在nginx配置的error_log里看到。