wordpress 被阿里云爆出了危险,文件路径。这个为何叫漏洞,因为黑客知道了服务器文件的存放路径,就可以针对路径来干点什么好事了。
Fatal error: Call to undefined function _deprecated_file() in /www/blog/wp-includes/class-snoopy.php on line 6
_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/http.php' );
前面加个@
@_deprecated_file( basename( __FILE__ ), '3.0.0', WPINC . '/http.php' );
ini_set('display_errors', false);
error_reporting(0);
我测试了error_reporting(E_ALL & ~E_NOTICE);没有用,依然报错来。
display_errors = Off
在程序运营过程中我们一般设置为display_errors = Off不显示错误,这样可以通过保存错误日志来记录运行状态
log_errors = On (记录错误日志)
log_errors = Off (不记录)
如果保存错误日志的话,需要同时设置错误日志保存文件
error_log = /www/php/logs/php_error.log
2020.12.26 php-fpm下关闭错误,要检查phpinfo,看看配置到底修改正确没有
php-fpm 需要修改/etc/php-fpm.d 下www.conf
php_flag[display_errors] = off
后记2021.1.9 服务器关闭了错误显示,但是某个单独的文件需要展示php错误怎么办
php文件的头部增加
error_reporting(E_ALL);
ini_set('display_errors', 'On');
wp-admin/admin-functions.php
wp-admin/upgrade-functions.php
wp-includes/class-snoopy.php
wp-includes/registration.php
wp-includes/rss-functions.php
wp-includes/rss.php
wp-includes/theme-compat/comments-popup.php
wp-includes/theme-compat/comments.php
wp-includes/theme-compat/footer.php
wp-includes/theme-compat/header.php
wp-includes/theme-compat/sidebar.php
wp-includes/registration-functions.php