對于我的網站,我使用 Laminas。我在開發服務器和公共生產服務器上本地運行它。我想向公眾隱藏錯誤,只讓它們在開發服務器上可見。因此我將這些行寫入 public/index.php 文件中:if(apache_getenv('APPLICATION_ENV')=='development'){ error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1);}else{ error_reporting(0); ini_set('display_errors', 0); ini_set('display_startup_errors', 0);}我但是仍然會看到錯誤消息 if APPLICATION_ENV='productive'。我已經檢查服務器是否運行if 代碼或else 代碼。這個問題不是關于處理錯誤,只是為了向公眾隱藏它的消息。
1 回答

慕絲7291255
TA貢獻1859條經驗 獲得超6個贊
config/autoload/local.php嘗試在您的生產服務器上進行編輯
'view_manager' => array(
'display_exceptions' => false
)
- 1 回答
- 0 關注
- 91 瀏覽
添加回答
舉報
0/150
提交
取消