0

I have tried to execute

(base) [sebastianr@user ~]$ php
bash: php: command not found


(base) [sebastianr@user ~]$ sudo ln -s /opt/llamp/bin/php /usr/bin/php
[sudo] password for sebastianr: 
ln: failed to create symbolic link '/usr/bin/php': File exists

the file is in usr/bin/ directory, what need I do?

  • if you type `echo $PATH` in the console, what is the result ? – Ken Lee Jun 22 '21 at 23:45
  • (base) [sebastianr@user bin]$ echo $PATH /home/sebastianr/anaconda3/bin:/home/sebastianr/anaconda3/condabin:/home/sebastianr/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin – Sebastian Romero Laguna Jun 22 '21 at 23:49
  • Thanks, the path (/usr/bin) is included. Then please check whether the php is executable (if not sure, use chmod a+x to make it executable). – Ken Lee Jun 22 '21 at 23:54
  • Ii tried with --- `(base) [sebastianr@sebastian-nitro5 bin]$ chmod a+x php chmod: cannot operate on dangling symlink 'php'` and after that by sudo: `[sebastianr@user bin]$ sudo chmod a+x php [sudo] password for sebastianr: chmod: cannot operate on dangling symlink 'php'`, but it did not work. – Sebastian Romero Laguna Jun 23 '21 at 00:13
  • Then there must be something wrong with your current one. Please remove the current problematic symbolic link first (by `rm`), then re-create the symbolic link. – Ken Lee Jun 23 '21 at 00:33

0 Answers0