开发者

php ini_set expose_php

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜