When creating a symbolic link, how do I troubleshoot 'too many levels of symbolic links'?

34,410

Beware that using ln -s target /path/symlink, the target will be interpreted as relative to the path 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:

me@laptop:~/PHPUnit$ ln -s ~/PHPUnit/phpunit /usr/bin/phpunit

(Using an absolute target is probably the best here)

Share:
34,410

Related videos on Youtube

user35538
Author by

user35538

Ziiweb is a web agency on creating websites and web applications. We also offer marketing online services (SEO/PPC) to promote your business through search engines and social networks. We always bet for the last and best web technologies: HTML5, CSS3, jQuery, PHP5 and symfony (all releases).

Updated on September 18, 2022

Comments

  • user35538
    user35538 over 1 year

    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...

    • Heisenbug
      Heisenbug over 12 years
      try to specify the full path of phpunit