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

Error when executing php command under linux

王林
王林Original
2020-01-11 14:41:083274browse

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

(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

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!

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