douliedai4838 2016-06-28 11:32
浏览 306
已采纳

如何在yii2中隐藏php警告?

My yii2 web application is hosted on shared server.

it is showing php warning - " PHP Core Warning – yii\base\ErrorException PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so' - libMagickWand.so.2:

cannot open shared object file: No such file or directory" now i want to disable php warning in my yii2 application how to achive that?

  • 写回答

4条回答 默认 最新

  • 普通网友 2017-11-17 11:05
    关注

    This can be achieved by changing two parameters in index.php file.

    1) Setting YII_DEBUG to false

    defined('YII_DEBUG') or define('YII_DEBUG', false);
    

    2) Setting YII_ENV to prod from dev

    defined('YII_ENV') or define('YII_ENV', 'prod');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?