Ask php7 how to restart php-fpm and how to remove X-Powered-By: PHP?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.