Sunday, July 17, 2022

[FIXED] How to hide php warning in yii2?

Issue

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?


Solution

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');


Answered By - Ninja Turtle
Answer Checked By - Mary Flores (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.