How do I correctly install PHPUnit with PEAR?

前端 未结 8 944
甜味超标
甜味超标 2021-01-31 08:22

I have had to de- and reinstall a newer version of PHPUnit following these directions. Now when I\'m launching this line

sudo pear install --alldeps phpunit/PHPU         


        
8条回答
  •  暖寄归人
    2021-01-31 08:36

    The easiest way to obtain PHPUnit in Ubuntu, Debian, Fedora or OpenSUSE is to download a PHP Archive (PHAR) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file.

    Open the terminal and type:

    wget https://phar.phpunit.de/phpunit.phar  # download the PHP Archive (PHAR) file  
    chmod +x phpunit.phar   
    sudo mv phpunit.phar /usr/local/bin/phpunit   
    

    There are many different versions of phpunit.phar at https://phar.phpunit.de/. If you use the first command, it will select and download the latest version.

    Note: The /usr/local/bin/ path in the last command is correct for Ubuntu, Debian, Fedora and OpenSUSE distributions and also for other Linux distributions that have a /usr/local/bin/ directory.

    Reference: What is /usr/local/bin? Came across it in an script installation for Applescript but would like to know more

提交回复
热议问题