Home  >  Article  >  Backend Development  >  Do I need to restart to modify php?

Do I need to restart to modify php?

藏色散人
藏色散人Original
2021-11-24 09:32:006168browse

After modifying php, you need to restart it. The method is: 1. Open the terminal command window; 2. Check the master process number of php-fpm; 3. Restart php-fpm.

Do I need to restart to modify php?

The operating environment of this article: linux5.9.8 system, PHP7.1, Dell G3 computer.

Does modification of php require a restart? What needs to be restarted to modify php.ini?

Requires a restart.

Generally whoever uses it will have no problem restarting it

Note: You must first know in what mode PHP is running.
is an independent executable program, or it can be embedded into a server program in the form of a module to run.
If it is nginx, it is usually in the form of an independent process, while apache is in the form of a module.
So nginx restarts the php process php-fpm, and apache restarts the apache service.

After modifying php.ini on the nginx server, you need to restart php-fpm for it to take effect

First check the master process number of php-fpm ---master

ps aux|grep php-fpm
root 42891 0.0 0.1 182796 1220 ? Ss 4月18 0:19 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)

Restart php-fpm:

kill -USR2  主进程ID        ------------master 进程id

Related operations

./nginx -t Verify whether the nginx configuration file is correct

nginx - s reload Reload the configuration file after modifying the nginx configuration

Start php-fpm:

/usr/local/php/sbin/php-fpm

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Do I need to restart to modify php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn