E_ALL &~E_DEPRECATED 没有按预期工作 [英] E_ALL & ~E_DEPRECATED not working as expected

查看:46
本文介绍了E_ALL &~E_DEPRECATED 没有按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在一个 PHP 站点上工作,它是一个旧系统,我遇到了一个错误

Hi am working on a PHP site , it is an old system and i got an error

已弃用:mysql_connect():mysql 扩展已弃用,并且将来会被移除:改用 mysqli 或 PDO...

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead...

现在我不打算将查询更改为 mysqliPDO ,我只是尝试添加

For now i am not going to change my queries to mysqli or PDO , i simply tried to add

error_reporting = E_ALL & ~E_DEPRECATED 

到我的 php.ini 并删除已弃用的错误消息.我的 php.ini 在 C:/xampp/php/php.ini 中,在我添加值后我重新启动了 apache .我也试过

to my php.ini and to remove the deprecated error messages . my php.ini is in C:/xampp/php/php.ini , after i added the value i restarted apache . also i tried with

error_reporting = E_ALL ^ E_DEPRECATED 

我也试过

error_reporting(E_ALL & ~E_DEPRECATED);

在我的 PHP 中,通用标头函数,但消息显示 .我想删除它们.

in my PHP , common header function , but the messages are showing . i want to remove them .

我的 MySQL 版本是 5.6.21

my MySQL version is 5.6.21

PHP 版本为 5.6.3

PHP version is 5.6.3

提前致谢.

推荐答案

您的日志中没有任何内容?

Nothing present in your logs?

快速浏览网络 &所以似乎值得尝试这个:

A quick browse around the net & SO seems to warrant trying this:

error_reporting(E_ALL ^ E_DEPRECATED);

应显示除已弃用警告之外的所有错误.

Which should show all errors except for the deprecated warnings.

您的另一个选择是仅指定您希望在 php.ini 文件中显示的内容.

Your other option would be to specify only what you want to be displayed in your php.ini file.

error_reporting = |E_ERROR|E_WARNING|.....etc

<小时>

参考资料


References

如果上述方法不起作用,ServerFault 上的这个答案可能会解决问题(提供不同的选项供您尝试.)

And if the above doesn't work, this answer on ServerFault might clear things up (Providing different options for you to try.)

这篇关于E_ALL &amp;~E_DEPRECATED 没有按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆