Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php ini_set expose_php_Php - Fatal编程技术网

php ini_set expose_php

php ini_set expose_php,php,Php,我试图用ini_集关闭expose_php,但它似乎不起作用。我尝试了值0,然后关闭,但都不起作用 ini_set('expose_php',0); 帮忙 我记得,这两个参数都必须是字符串。试试看。 它只能在php.ini中设置。覆盖标题: header('X-Powered-By: '); 如果您使用的是PHP>=5.3.0: header_remove('X-Powered-By'); 或在旧版本上: header('X-Powered-By: '); (这将隐藏PHP和版本,但“

我试图用ini_集关闭expose_php,但它似乎不起作用。我尝试了值0,然后关闭,但都不起作用

ini_set('expose_php',0);
帮忙

我记得,这两个参数都必须是字符串。试试看。

它只能在php.ini中设置。

覆盖标题:

header('X-Powered-By: ');

如果您使用的是PHP>=5.3.0:

header_remove('X-Powered-By');

或在旧版本上:

header('X-Powered-By: ');
(这将隐藏PHP和版本,但“X-Powered-By”字符串仍将在标题中可见。)


但是,PHP版本可能仍然在标题的“服务器:”部分可见。所以这不是防弹的。

expose_php
display_errors
?哎哟lol复制了错误的行,expose_phpServer头可以通过以下方式删除:
header_remove('Server')。我编辑了答案以包含这个!
header('X-Powered-By: ');