What to do if php-fpm fails to restart
php-fpm重启失败的解决办法:1、查看一下对应的nginx的配置文件为“root@example:/# vim /etc/nginx/sites-enabled/example.conf”;2、通过“service php7.0-fpm restart”命令重启即可。
本教程操作环境:ubuntu 16.04系统、php7.0版、DELL G3电脑
php-fpm 重启失败怎么办?
在 Ubuntu 服务器上重启 php-fpm失败
在 Ubuntu 服务器上修改过 PHP 配置文件后,想重启 php-fpm ,结果出现了这样的问题:
root@example:/# service php-fpm restart php-fpm: unrecognized service
查看一下对应服务:
root@example:/# service --status-all | grep -i fpm [ ? ] aliyun-rdate [ ? ] console-setup [ ? ] dns-clean [ ? ] irqbalance [ ? ] killprocs [ ? ] kmod [ ? ] mysql [ ? ] networking [ ? ] ondemand [ + ] php5-fpm [ + ] php7.0-fpm [ ? ] pppd-dns [ ? ] rc.local [ ? ] sendsigs [ ? ] umountfs [ ? ] umountnfs.sh [ ? ] umountroot
原来之前的人给服务器装了两个版本的 php-fpm ,而且都不名字都不叫 php-fpm ,所以我光打个 php-fpm 系统是不认识的。
查看一下对应的 nginx 的配置文件:
root@example:/# vim /etc/nginx/sites-enabled/example.conf 1 server { 2 listen 80; 3 server_name abc.example.com; 4 root /mnt/www/example; 5 index index.php index.html; 6 7 location ~ \.php$ { 8 fastcgi_pass unix:/run/php/php7.0-fpm.sock; 9 fastcgi_index index.php; 10 include fastcgi_params; 11 } 12 13 location / { 14 if (!-e $request_filename) { 15 rewrite ^(.*)$ /index.php?s=$1 last; 16 break; 17 } 18 } 19 20 }
它监听的是 php7.0-fpm , 所以只需重启这个就行:
root@example:/etc/nginx/sites-enabled# service php7.0-fpm restart php7.0-fpm stop/waiting php7.0-fpm start/running, process 2807 root@example:/etc/nginx/sites-enabled#
推荐学习:《PHP视频教程》
The above is the detailed content of What to do if php-fpm fails to restart. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to use php-fpm for high-performance tuning PHP is a very popular server-side scripting language that is widely used to develop web applications and dynamic websites. However, as traffic increases, the performance of your PHP application may suffer. In order to solve this problem, we can use php-fpm (FastCGIProcessManager) for high-performance tuning. This article will introduce how to use php-fpm to improve the performance of PHP applications and provide code examples. one,

How to use PHP-FPM optimization to improve the performance of PrestaShop applications. With the rapid development of the e-commerce industry, PrestaShop has become the e-commerce platform chosen by many merchants. However, as the size of the store increases and the number of visits increases, the PrestaShop application may encounter performance bottlenecks. In order to improve the performance of the PrestaShop application, a common method is to use PHP-FPM to optimize and improve the application's processing capabilities. PHP-FPM (FastCGI

How to Improve the Performance of WooCommerce Applications Using PHP-FPM Optimization Overview WooCommerce is a very popular e-commerce plugin for creating and managing online stores on WordPress websites. However, as your store grows and traffic increases, WooCommerce apps can become slow and unstable. To solve this problem, we can use PHP-FPM to optimize and improve the performance of WooCommerce applications. What is PHP-FP

Overview of using php-fpm connection pool to improve database access performance: In web development, database access is one of the most frequent and time-consuming operations. The traditional method is to create a new database connection for each database operation and then close the connection after use. This method will cause frequent establishment and closing of database connections, increasing system overhead. In order to solve this problem, you can use php-fpm connection pool technology to improve database access performance. Principle of connection pool: Connection pool is a caching technology that combines a certain number of databases

How to use PHP-FPM to optimize and improve the performance of Phalcon applications. Introduction: Phalcon is a high-performance PHP framework. Combining with PHP-FPM can further improve the performance of applications. This article will introduce how to use PHP-FPM to optimize the performance of Phalcon applications and provide specific code examples. 1. What is PHP-FPMPHP-FPM (PHPFastCGIProcessManager) is a PHP process independent of the web server

PHP-FPM is a commonly used PHP process manager used to provide better PHP performance and stability. However, in a high-load environment, the default configuration of PHP-FPM may not meet the needs, so we need to tune it. This article will introduce the tuning method of PHP-FPM in detail and give some code examples. 1. Increase the number of processes. By default, PHP-FPM only starts a small number of processes to handle requests. In a high-load environment, we can improve the concurrency of PHP-FPM by increasing the number of processes

What is php-fpm? The following article will take you to understand php-fpm and introduce what we need to optimize when optimizing php-fpm. I hope it will be helpful to everyone!

Solution for Ubuntu without php-fpm: 1. Add the source address of PHP by executing the "sudo apt-get" command; 2. Check whether there is a php7 package; 3. Install PHP by executing the "sudo apt-get install" command; 4. , modify the configuration to listen on port 9000 to handle nginx requests; 5. Start "php7.2-fpm" through "sudo service php7.2-fpm start".
