第一次,我尝试使用 proxy_hide_header 将其剥离,但它不起作用
然后我改变了 etc/php.ini ,设置了 expose_php = Off
但 X-Powered-By 标头仍然存在
root@wordpress:~# ps -ef |grep php | grep -v grep
root 10643 1 0 23:22 ? 00:00:00 php-fpm: master process (/usr/local/php-5.3.26/etc/php-fpm.conf)
nobody 10644 10643 0 23:22 ? 00:00:00 php-fpm: pool www
nobody 10645 10643 0 23:22 ? 00:00:00 php-fpm: pool www
root@wordpress:~#
我的 php 版本是 php 5.3.26
Configure Command => './configure' '--prefix=/usr/local/php-5.3.26' '--with-config-file-path=/usr/local/php-5.3.26/etc' '--enable-fpm' '--enable-debug' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--with-bz2' '--with-curl=/usr/lib/' '--with-readline=/lib' '--with-libxml-dir=/usr/lib' '--with-mysql=/usr/local/mysql'
PHP Version => 5.3.26
System => Linux wordpress.ruby-mine.com 3.9.3-x86_64-linode33 #1 SMP Mon May 20 10:22:57 EDT 2013 x86_64
Build Date => Jun 11 2013 21:58:26
Configure Command => ./configure --prefix=/usr/local/php-5.3.26 --with-config-file-path=/usr/local/php-5.3.26/etc --enable-fpm --enable-debug --with-openssl --with-pcre-regex --with-zlib --with-bz2 --with-curl=/usr/lib/ --with-readline=/lib --with-libxml-dir=/usr/lib --with-mysql=/usr/local/mysql
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/php-5.3.26/etc
而且我还注意到, php -i 的输出显示expose_php = on
root@wordpress:/usr/local/php/etc# php -i | grep Configuration
Configuration File (php.ini) Path => /usr/local/php-5.3.26/etc
Loaded Configuration File => (none)
Configuration
root@wordpress:/usr/local/php/etc#
root@wordpress:/usr/local/php-5.3.26/etc# ll /usr/local/php-5.3.26/etc/php.ini
-rw-rw-rw- 1 root root 69628 Jun 11 22:51 /usr/local/php-5.3.26/etc/php.ini
root@wordpress:/usr/local/php-5.3.26/etc#