2011-07-30 84 views
0

我覺得自己像一個巨大的noob,但我剛剛推到一個GoDaddy共享Linux主機的網站,因爲我的數據庫連接沒有安裝,我看到了警告消息。我擔心任何警告/錯誤/通知都會直接顯示在頁面上。我怎樣才能讓這些重定向到一個錯誤文件,而不是我想讓這些文件公開顯示(儘管它們應該不會發生)。重定向php警告消息

回答

1

你的朋友是在php.ini,並在那裏這些屬性:

http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors - 設置爲 「0」 http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors -set爲 「1」

您可以控制要顯示什麼錯誤/記錄:

http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting

你可以設置php.ini中的屬性以及在代碼:

http://www.php.net/manual/en/configuration.changes.modes.php

編輯:

所有屬性的列表:http://php.net/manual/en/ini.list.php

+0

感謝..通過東西合作。努力讓它使用我設置的* error_log *。但是我已經擺脫了將* display_errors *設置爲*關閉的那些標準輸出* – rewolf

+0

也可以指定錯誤日誌位置。調用'phpinfo()'來查看你的日誌進入的地方。 –