报错:Directive ‘track_errors’ is deprecated

2018年9月18日 | 分类: 【技术】

参考:https://github.com/SublimeLinter/SublimeLinter-phplint/issues/31
参考:https://www.cnblogs.com/gyfluck/p/9076583.html

当升级到 PHP 7.2时,查看版本:

php -v

输出:

PHP Deprecated:  Directive 'track_errors' is deprecated in Unknown on line 0

Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
PHP 7.2.10 (cli) (built: Sep 17 2018 14:06:04) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

The track_errors was deprecated in PHP 7.2

打开 php.ini :

修改:

track_errors=On

为:

track_errors=Off

When the track_errors ini setting is enabled, a $php_errormsg variable is created in the local scope when a non-fatal error occurs. Given that the preferred way of retrieving such error information is by using error_get_last(), this feature has been deprecated.

参考:http://php.net/manual/pt_BR/migration72.deprecated.php