Boba Fit
Boba Fit

Reputation: 829

Laminas hide errors on productive server

For my website, I use Laminas. I run it locally on a development server and on a public productive server. I want to hide errors to the public and only let them be visible on the dev server. Therefore I wrote these lines into the public/index.php file:

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

I but error messages still get seen if APPLICATION_ENV='productive'.


I already checked wheter the server runs the if code or else code.

This question is not about handling an error, just to hide it's message to the public.

Upvotes: 1

Views: 1240

Answers (1)

Khaled Alam
Khaled Alam

Reputation: 905

try to edit config/autoload/local.php on your production server

'view_manager' => array(
    'display_exceptions' => false
)

Upvotes: 3

Related Questions