問題:
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/includes/page.class.php on line 8
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant pageft - assumed 'pageft' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/includes/page.class.php on line 9
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant ALL_PS - assumed 'ALL_PS' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/admin_global.php on line 8
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant uid - assumed 'uid' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/admin_global.php on line 11
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant shell - assumed 'shell' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/admin_global.php on line 12
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/includes/action.class.php on line 22
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant passwd - assumed 'passwd' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/includes/action.class.php on line 22
- [06-Oct-2023 17:18:12 Asia/Taipei] PHP Warning: Use of undefined constant m_id - assumed 'm_id' (this will throw an Error in a future version of PHP) in /home/pipe/public_html/modules/shopcart/admin/includes/action.class.php on line 28
複製代碼 問題描述; 進入網站會出現大量類似下面的提示,但是可以正常顯示和運行. 最大的問題是LOG檔案占空間,沒多久就數十GB 答案 這些是 PHP 的提示而非報錯,PHP 本身不需要事先宣告變數即可直接使用,但對未宣告變數會有提示。一般作為正式的網站會把提示關掉的,甚至連錯誤訊息也被關掉. 關閉 PHP 提示的方法 搜尋php.ini: error_reporting = E_ALL 改為: error_reporting = E_ALL & ~E_NOTICE 還有個不是辦法的辦法就是 在每個文件頭上加 error_reporting(0); 雖然不好弄但是可以解決問題.
|