Solution to php-fpm.service not found, 302found
Preface
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
Solution
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'
Summary
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.