php列印錯誤日誌到本地,php怎樣列印錯誤日誌

2021-10-25 22:34:52 字數 708 閱讀 2124

php列印錯誤日誌的方法:1、編輯php-fpm.conf配置檔案;2、修改php.ini配置檔案;3、重啟php-fpm;4、在指令碼中新增【ini_set('display_errors', 0);】。

具體方法:

1、修改php-fpm.conf配置檔案catch_workers_output = yes

error_log = log/php_error.log

2、修改php.ini配置檔案log_errors = on

error_log = /user/local/php/log/error_log

3、重啟php-fpm

注意:如果php.ini檔案找不到,請在頁面輸出phpinfo()可以查到。php錯誤日誌不輸出到日誌和螢幕上

4、在配置檔案php.ini中修改display_errors = off

log_error = on

error_reprting = e_all

5、在程式中修改ini_set('display_errors', 0);

ini_set('error_reporting', e_all);

ini_set('error_log', '日誌檔案');

ini_set('log_errors', 1);

php列印錯誤資訊

方法一 修改php.ini 顯示錯誤資訊 display errors on 顯示php開始錯誤資訊 display startup errors on 日誌記錄錯誤資訊 log errors on方法二 需要除錯的php 檔案頭部加入 ini set display errors 1 錯誤資訊 i...

PHP中上傳檔案列印錯誤,錯誤型別

一般使用 files來進行檔案上傳時,可以使用 files file error 來判斷檔案上傳是否出錯。files file error 會返回相應的錯誤 upload err ok 其值為 0,沒有錯誤發生,檔案上傳成功。upload err ini size 其值為 1,上傳的檔案超過了 ph...

php如何輸出提示錯誤資訊 php列印錯誤資訊

顯示php開始錯誤資訊 display startup errors on 日誌記錄錯誤資訊 log errors on 方法二 需要除錯的php 檔案頭部加入ini set display errors 1 錯誤資訊 ini set display startup errors 1 php啟動錯誤...