We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

chmod: cannot operate on dangling symlink ‘/usr/bin/phalcon’

I have installed Phalcon extension sucessfully on my Linux Mint system. But after installing Phalcon devtool there is a problem. I cloned the git repo and create the link by using "sudo ln -s ~/phalcon-devtools/phalcon.php /usr/bin/phalcon" but whileing runing "sudo chmod ugo+x /usr/bin/phalcon", I am getting error "chmod: cannot operate on dangling symlink ‘/usr/bin/phalcon’"

What is the problem and how to fix it?



8.1k

Don't need to do so. This is system danging potentially. You can choose between 2 case:

  1. Create simlink in /usr/local/bin

  2. Just add path to your ~/phalcon-devtools/phalcon.php to $PATH in bashrc and create alias

export PATH=$PATH:your_home_directory/phalcon-devtools/phalcon.php

alias phalcon = "phalcon.php"

phalcon.php must have exec flag and php Sha-Bang, of course



33.7k

@Oleg Thanks for replaying.

I am very new to linux, so could you please give me all the commands



8.1k
Accepted
answer
  1. run
find ~ -name 'phalcon.php'

For example, you can see output

/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php

And add your output to command

echo 'alias phalcon="/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php"'>>~/.bashrc 

To work right away without relogin, you can run

alias phalcon="/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php


33.7k
edited Jul '14

Thanks Oleg, it is working..

edited Nov '14

1.vim .bashrc .

alias phalcon="/home/yourpath/vendor/phalcon/devtools/phalcon.php".

2.run command 'source'.

source

3.run command 'phalcon'.

phalcon



84
edited Jul '15

A dangling symlink is a symlink pointing to an invalid location: https://ubuntuforums.org/showthread.php?t=1078729

I solved this by removing the incorrect symlink and then recreating it with the correct path. You must run these commands from the phalcon dev tools directory or provide the full path to phalcon.php in the ln command:

  1. rm -rf /usr/bin/phalcon
  2. sudo ln -s phalcon.php /usr/bin/phalcon
  3. sudo chmod ugo+x /usr/bin/phalcon

Beer cheers, mrns

When creating symbolic link, specify the full path to phalcon.php

ln -s /home/user/www/phalcon-devtools/phalcon.php /usr/bin/phalcon

all right!

  1. run
find ~ -name 'phalcon.php'

For example, you can see output

/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php

And add your output to command

echo 'alias phalcon="/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php"'>>~/.bashrc 

To work right away without relogin, you can run

alias phalcon="/home/patrick/develop/phalcontools/vendor/phalcon/devtools/phalcon.php

Im new to in linux and i dont really understand how to use it this example..