I am new with cakePHP. I facing issue with notice on live server. I want to suppress or turn off these notices. I have tried adding,
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
in the index.php file in main folder. Also added same in bootstrap.php file but no luck. Can anybody suggest me how I can do this.
Open config/core.php
seach this
Configure::write('debug', 0);
You can disable the debug feature by turning debug to 0 in the app\Config\core.php file
Configure::write('debug', 0);
If still you get the same issue so please check your live server Php version and also check the same on development server, I think there is php version compatibility issue so please see link http://bakery.cakephp.org/articles/markstory/2013/07/05/cakephp_2_3_7_2_4_0-beta_released
Hope it should work for you.
In the core.php file in /app/config, find this line and edit the level of errors you want to show: Configure::write('Error', array( 'handler' => 'ErrorHandler::handleError', 'level' => E_ALL & ~E_DEPRECATED, 'trace' => true ));
You may now add or remove the error levels as given on this page: http://php.net/manual/en/function.error-reporting.php
You are getting warnings and notice just because your DEBUG is TRUE. to solve this probem.
Go to config/app.php
and just change true to false as done below..
Find this line
'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),
And change above line to
'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),