Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify php-fpm users

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, the editor will show you how to modify php-fpm users. The knowledge points in the article are introduced in great detail. Friends who feel helpful can browse the content of the article with the editor, hoping to help more friends who want to solve this problem to find the answer to the problem. Follow the editor to learn more about "how to modify php-fpm users".

Modify the method of php-fpm user: 1, modify "user = test group = test"; 2, modify the permissions of "php7.0-fpm.pid" and "php7.0-fpm.sock"; 3, restart php-fpm.

This article operating environment: Windows7 system, PHP7.0 version, DELL G3 computer

How to modify php-fpm users?

Modify php-fpm and nginx running users:

(php) Project an is run with test users

Nginx and php-fpm are run by www-data users

(python) Project b is run with test users

Project a calls the interface of the python script through the php function exec, resulting in no permission to access the directory

Directly change the permissions of project b to www-data can be executed, but it is not convenient for development, it is best to put php, nginx, project a, project b all under one user or group.

For example, test is the currently logged-in user

Modify the running role of nginx

The cd / etc/nginxsudo vi nginx.conf# header looks like this: user www-data;worker_processes auto;pid / run/nginx.pid;include / etc/nginx/modules-enabled/*.conf;# is modified to user test;worker_processes auto;pid / run/nginx.pid;include / etc/nginx/modules-enabled/*.conf;# to restart nginxsudo service nginx restart

Modify the running role of php

Cd / etc/php/7.0/fpm/pool.d/sudo vi www.conf# finds user = www-datagroup = www-data# to change to user = testgroup = testcd / run/php/ls-al# under this directory there are two files # php7.0-fpm.pid and php7.0-fpm.sock# modify the permissions of these two files sudo chown test:test php7.0-fpm.pidsudo chown test:test php7.0-fpm.sock# restart php-fpmsudo service php7-fpm restart

Test users make it up and modify it according to their current users.

What are the characteristics of php 1, the execution speed is fast. 2. It has good openness and expansibility. 3. PHP supports a variety of mainstream and non-mainstream databases. Object-oriented programming: PHP provides classes and objects. 5. The update speed of the version is fast. 6. It has rich functions. 7. Scalability. 8. Comprehensive functions, including graphics processing, encoding and decoding, compressed file processing, xml analysis and so on.

Thank you for reading, the above is the whole content of "how to modify php-fpm users", learn friends hurry up to do it. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report