Search code examples
phpphpunitpearwinginx

Installing PEAR + PHPUnit under WINGINX


I need PHPUnit and according to their GitHub page I need to use PEAR to install it.

Problem is, PEAR is not installed by default on WINGINX nor does my PHP folder have a go-pear.bat file as mentioned here: http://pear.php.net/manual/en/installation.getting.php.

So, how do I install PEAR / PHPUnit on WINGINX??

Using Apache is not an option since I need to learn to work with NGINX.

There's little to none documentation on this due WINGINX was released only a few months ago.

This tutorial does also not work since WINGINX does NOT support .htaccess


Solution

  • I have found a solution!! Since no documentation about this exists yet, and other people might come across this issue as well, I'll explain here how to fix this:

    1. Download the go-pear.phar file and place it in the C:\Winginx\php5\ directory
    2. Open up a terminal and navigate to C:\Winginx\php5\
    3. Type: php go-pear.phar and press enter
    4. Follow the instructions on your screen
    5. Restart NGINX
    6. Open a terminal as Administrator
    7. Run these 2 commands:
    pear config-set auto_discover 1
    pear install pear.phpunit.de/PHPUnit
    

    Done! You successfully installed PHPUnit