I'm trying to create a symbolic link on Ubuntu 10.04 ((Lucid Lynx)) it says:
me@laptop:~/PHPUnit$ ls
assertions.php LICENSE PHPUnit README.markdown
build.xml package.xml phpunit.bat Tests
ChangeLog.markdown phpunit phpunit.xml.dist
me@laptop:~/PHPUnit$ ln -s phpunit /usr/bin/phpunit
ln: accessing `/usr/bin/phpunit': Too many levels of symbolic links
And when I do /usr/bin$ ls php*
I just get:
php php5 php-config php-config5 phpize phpize5
I tried to create it before, and I'm not sure if I run a wrong command…
Best Answer
Beware that using
ln -s target /path/symlink
, thetarget
will be interpreted as relative to thepath
directory (where the symlink will belong). Your command would create a symlink that points to itself. Hence, a path lookup loop would occur every time the symlink is accessed.In your case, maybe
/usr/bin/phpunit
already exists and is self-looping. Remove it first and change your command to:(Using an absolute target is probably the best here)