Background:
Server: CentOS7 + nginx/1.9.15 + PHP7.0.8 + Mysql
Reason:
Found in the response header: x-powered-by:php/7.0.8
Trying to get rid of it.
Then modify the php.ini file, set the expose_php to off, and then restart Nginx,
Found the goods are still there good.
It is not known if the PHP-FPM did not restart, but found that PHP-FPM did not restart the option.
Ask the gods how to deal with the above situation?
How do I restart php-fpm and how do I get rid of x-powered-by?
Thank you
Summary: If the php.ini has been modified, in addition to restart Nginx, for CentOS need to PHP-FPM process kill, and then start, so that the changes will be effective!
Reply content:
Background:
Server: CentOS7 + nginx/1.9.15 + PHP7.0.8 + Mysql
Reason:
Found in the response header: x-powered-by:php/7.0.8
Trying to get rid of it.
Then modify the php.ini file, set the expose_php to off, and then restart Nginx,
Found the goods are still there good.
It is not known if the PHP-FPM did not restart, but found that PHP-FPM did not restart the option.
Ask the gods how to deal with the above situation?
How do I restart php-fpm and how do I get rid of x-powered-by?
Thank you
Summary: If the php.ini has been modified, in addition to restart Nginx, for CentOS need to PHP-FPM process kill, and then start, so that the changes will be effective!
PS aux | grep php-fpm
Find the PID, then kill the PID
and then
/usr/local/php7/sbin/php-fpm
Start
How to get rid of x-powered-by? Your operation is right, if not, see which directory php.ini is reading
Php-i | grep php.ini, and then the corresponding modifications are good
Ubuntu is: sudo service php7.0-fpm Restart, you can refer to the next try Haha
No php-fpm used on CentOS, but used on Ubuntu, restart command is sudo service php5-fpm restart
. For reference only.