Background: Server: CentOS7 + nginx1.9.15 + PHP7.0.8 + Mysql cause: the response header contains X-Powered-By: PHP7.0.8. if you want to remove it, modify php. ini file, set expose_php to Off, restart nginx, and find that this product is still good .... Background:
Server: CentOS7 + nginx/1.9.15 + PHP7.0.8 + Mysql
Cause:
The response header contains X-Powered-By: PHP/7.0.8.
I want to remove it.
Modify the php. ini file, set expose_php to Off, and restart nginx,
I found that this product is still good.
I don't know why php-fpm didn't restart, but I found that php-fpm didn't have the restart option.
How can we solve the above problems?
How do I restart php-fpm and remove X-Powered-?
Thank you.
Summary: If you modify php. ini, in addition to restarting nginx, you need to kill the php-fpm process for centOS and then start it. this modification will take effect!
Reply content:
Background:
Server: CentOS7 + nginx/1.9.15 + PHP7.0.8 + Mysql
Cause:
The response header contains X-Powered-By: PHP/7.0.8.
I want to remove it.
Modify the php. ini file, set expose_php to Off, and restart nginx,
I found that this product is still good.
I don't know why php-fpm didn't restart, but I found that php-fpm didn't have the restart option.
How can we solve the above problems?
How do I restart php-fpm and remove X-Powered-?
Thank you.
Summary: If you modify php. ini, in addition to restarting nginx, you need to kill the php-fpm process for centOS and then start it. this modification will take effect!
Ps aux | grep php-fpm
Find the pid and kill the pid.
Then
/Usr/local/php7/sbin/php-fpm
Start
How to Remove X-Powered-? Your operation is correct. if it does not take effect, check which Directory php. ini is read.
Php-I | grep php. ini, and the corresponding modification is fine.
Ubuntu is: sudo service php7.0-fpm restart. for details, refer to try again.
I have not used php-fpm on CentOS, but I have used it on Ubuntu. The Restart command issudo service php5-fpm restart
. For reference only.