Home >Backend Development >PHP Problem >What should I do if centos cannot find the php command?

What should I do if centos cannot find the php command?

藏色散人
藏色散人Original
2021-07-17 10:05:492391browse

Centos cannot find the php command: first execute "export PATH=$PATH:/usr/local/php/bin"; then execute "echo $PATH".

What should I do if centos cannot find the php command?

The operating environment of this article: centOS6.8 system, PHP7.1 version, DELL G3 computer

centos cannot find the php command what to do?

-bash: php: command not found Command not found

This problem is actually very simple. If you enter a command in the terminal and the system prompts If you say Command not found, it is either because you have not installed the corresponding software package, or because of a path setting problem. If it is because of a software package problem, there is nothing else to say, just install the corresponding software package. In another case, the user's path needs to be set.

-bash: ls: command not found 或者 -bash: ll: command not found

Cause: When setting environment variables, the editing profile file was not written correctly, resulting in commands such as ls not being recognized on the command line.

Solution:

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
bash: PHP: command not found

Solution:

export PATH=$PATH:/usr/local/php/bin

Then, echo $PATH and see, you will see it.

usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/php/bin

At this time, you can directly type php -i in any directory of the system to execute it.

-bash:unzip: command not found

-bash: Two solutions to wget: command not found

Generally, when Linux is minimally installed, wget will not be installed by default.

Can be installed through the following two methods:

1. rpm installation

rpm download source address: http://mirrors.163.com/centos/6.2/ os/x86_64/Packages/

Download the RPM package of wget: http://mirrors.163.com/centos/6.2/os/x86_64/Packages/wget-1.12-1.4.el6.x86_64.rpm

rpm ivh wget-1.12-1.4.el6.x86_64.rpm Just install it.

2. yum installation

yum -y install wget

80 port prompt has been occupied

httpd not running, trying to start
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Solution:

# netstat -lnp|grep :80
tcp 0 0 :::80 :::* LISTEN 2184/httpd
杀掉服务
# killall -9 httpd
重启
# /etc/init.d/httpd start

Recommended study: "PHP Video Tutorial

The above is the detailed content of What should I do if centos cannot find the php command?. 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