Home >Operation and Maintenance >Linux Operation and Maintenance >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!