我如何解决这个奇怪的问题呢?我在我的VPS上将PHP更新到5.6.0,现在在这个特定的脚本上,当我之前没有得到它们时,我得到了这两个错误,而且他们真的不给我任何东西。
<br />
<b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br />
此脚本只是通过一些命令运行各种服务的状态 shell_exec
并以JSON的形式返回响应。它不会使用任何帖子数据,甚至不包含 $_POST
在文件中。我脚本中的第一件事是:
<?php
error_reporting(0);
header('Content-Type: application/json');
我注释掉了最后一行,并且仍然收到有关修改标题信息的警告。我不知道为什么这些错误会在旧版本(5.5.16)上正常工作时出现