Home > Operation and Maintenance > Linux Operation and Maintenance > Error when executing php command under linux

Error when executing php command under linux

王林
Release: 2020-01-15 10:49:37
Original
3286 people have browsed it

Error when executing php command under linux

The problem arises:

When executing php under linux, it cannot be executed and an error message is reported: php: command not found

Solution:

export PATH=$PATH:/usr/local/php7/bin
Copy after login

(Online video tutorial sharing: linux video tutorial)

You can enter echo $PATH to check whether the addition is successful, as shown below:

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

If it still doesn't work, enter the following command again:

ln -s /usr/local/php/bin/php /usr/bin/php
Copy after login

Execute the test again.

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of Error when executing php command under linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template