Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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?


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


@Oleg Thanks for replaying.

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

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

For example, you can see output


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

edited Jul '14

Thanks Oleg, it is working..

edited Nov '14

1.vim .bashrc .

alias phalcon="/home/yourpath/vendor/phalcon/devtools/phalcon.php". command 'source'.

source command 'phalcon'.


edited Jul '15

A dangling symlink is a symlink pointing to an invalid location:

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