Solution to php-fpm.service not found, 302found

Source: Internet
Author: User

Solution to php-fpm.service not found, 302found


This article gives you a detailed introduction to solve the problem of php-fpm.service not found related content, the introduction of the article is very detailed, Next let's take a look at the detailed introduction:

Environment Introduction

Environment: ubuntu 16.04 64

Php version: php-7.1.4

Problems Found

Compile and install php normally.init.d.php-fpm Copy to/etc/init. d/php-fpm

Then prepare to executeservice php-fpm start An error occurred.

The error is as follows:

Failed to start php-fpm.service: Unit php-fpm.service not found. 

Promptphp-fpm.service not found

At first, I thought it was a php compilation and installation problem, so I directly went to the php Directory to execute php-fpm, everything works.

However, services cannot be managed.

Directly view the php-fpm management script, try debugging, and finally find the executionservice The script is not executed at all.

Basic troubleshooting of php Problems


Finally, I found it.service Command Information, find the solution

In ubuntu 16.04, in addition to copying files to the/etc/init. d/directory, you also need to use the following command

Update-rc.d php-fpm defaults // Add update-rc.d ServiceName defaults // Delete update-rc.d ServiceName remove

After the solution, we found that php-fpm was run separately.service Running Problems

[05-May-2017 17:09:32] ERROR: An another FPM instance seems to already listen on /run/php/php7.0-fpm.sock[05-May-2017 17:09:32] ERROR: FPM initialization failed

The prompt is that we already have a php-fpm running. Because I ran it in sock mode, I didn't find the pid. I checked the php-fpm management script code and found a solution.

stop)  echo -n "Gracefully shutting down php-fpm " if [ ! -r $php_fpm_PID ] ; then  echo "warning, no pid file found - php-fpm is not running ?"  exit 1 fi kill -QUIT `cat $php_fpm_PID` wait_for_pid removed $php_fpm_PID if [ -n "$try" ] ; then  echo " failed. Use force-quit"  exit 1 else  echo " done" fi ;;

Direct execution

Kill-QUIT 'cat php_fpm_PID Path'


The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

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: 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.