-bash: php: command not found

这个问题其实很简单,如果你在终端输入一个命令,而系统提示你说命令没有找到(Command not found)的话,要么是因为你没有装相应的软件包,要么就是因为路径设置的问题。如果是因为软件包的问题,那没有别的好说的,安装相应的软件包就好了。而另外一种情况,则需要对用户的路径进行设置。

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

原因:在设置环境变量时,编辑profile文件没有写正确,导致在命令行下 ls等命令不能够识别。

解决:

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

解决:

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

执行下面这行代码让刚刚改的环境变量生效

source /etc/profile

然后,再 echo $PATH 看看,就看见了。

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

这时候,你可以在系统的任意目录直接敲入php -i 都可以执行了。

-bash:unzip: command not found

-bash: wget: command not found

解决:
一般linux最小化安装时,wget不会默认被安装。
可以通过以下两种方法来安装:
1、rpm 安装
rpm 下载源地址:http://mirrors.163.com/centos/6.2/os/x86_64/Packages/
下载wget的RPM包: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 安装即可。

2、yum安装

yum -y install wget

80端口提示已经被占用

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

解决:

# netstat -lnp|grep :80
tcp 0 0 :::80 :::* LISTEN 2184/httpd

杀掉服务

# killall -9 httpd

重启

# /etc/init.d/httpd start
Last modification:December 17th, 2018 at 01:37 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment