I am trying to get开发者_运维问答 expose_php to off with ini_set, except it seems to not be working. I tried the value 0, and Off, but neither work.
ini_set('expose_php',0);
help?
http://php.net/manual/en/ini.core.php
It can only be set in php.ini.
If you are on PHP >= 5.3.0:
header_remove('X-Powered-By');
http://www.php.net/manual/en/function.header-remove.php
Or on an older version:
header('X-Powered-By: ');
(This will hide PHP and the version, but the "X-Powered-By" string will still be visible in the header.)
However the PHP version might still be visible in the "Server: " part of the header. So this isn't bulletproof.
Overwrite the header:
header('X-Powered-By: ');
ini_set('display_errors','0');
Both parameters need to be strings, as I recall. Try that.
精彩评论