Home  >  Article  >  Operation and Maintenance  >  How to check if php is running in linux

How to check if php is running in linux

藏色散人
藏色散人Original
2023-03-22 09:25:593795browse

How to check whether php is running on linux: 1. Log in to the linux system and enter the terminal; 2. Check php by executing the "ps -ef | grep php" command or the "ps -A | grep -i php" command Just start it or not.

How to check if php is running in linux

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

How to check if php is running in Linux?

Check if php is started & restart php & kill php process under linux

@查看php是否启动
    1)ps -ef | grep php 或者 ps -A | grep -i php 
 
@开启php
 1) php-fpm start
 
@停止php
1) php-fpm stop
@重启php
1) php-fpm restart
@杀死进程
1) kill -9 【pid】
@杀死php全部进程
1) killall -9 php

Related expansion:

PS is one of the Linux system commands and is used in Linux In is the command to view the process. ps to view the running process, ps aux to view all processes.

Linux processes have 5 states

  • Running status (running or waiting in the run queue [Ready Queue])

  • Interrupted state (sleeping, blocked, waiting for a certain condition to form or receiving a signal)

  • Uninterruptible state (receiving a signal does not wake up and cannot be run, the process must Wait until an interrupt occurs)

  • Zombie state (the process has been terminated, but the process descriptor exists until the parent process calls the wait4() system call and is released)

  • Stop state (the process stops running after receiving SIGSTOP, SIGSTP, SIGTIN, SIGTOU signals)

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to check if php is running in linux. 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