首先更新到最新版本的 PHP。
然后,确保 PHP 在您的环境 PATH 变量中。你可以在谷歌上查找如何做到这一点。
完成该设置后,您也必须安装 phpunit。WAMP 可能会附带它,但我对此表示怀疑。如果你有梨,通常这很容易。您可以从 phpunit 站点获取 pear 命令。
如果您没有梨,则必须安装它。下载适合您的“go-pear.phar”文件。您通常通过运行来安装它php go-pear.phar' and then you can use pear it install phpunit.
You can then call it a day OR you can continue setting up Netbeans to automatically use phpunit.
If you don't setup netbeans then you'll have to just use phpunit on the command line.
After the pear phpunit install just run phpunit on the command line and you should get some sort of 'help' output.
Edit : Step by step details.
I'm going to assume you have xdebug, php, netbeans installed from your comments. It seems like your only issue is installing phpunit.
Here goes.
Open up a command prompt
Open a browser window.
In your browser go to http://pear.php.net/go-pear
Save the text file that comes up into the directory php is installed in.
Go to the php directory php is installed in via the cd command on the terminal.
Type in the command php go-pear.phar
Follow the installation instructions for pear and pick the options that make the most sense. I just install everything in the php directory so php and pear live in the same place.
After pear is installed type in the following commands ( from the phpunit install website : http://www.phpunit.de/manual/current/en/installation.html ) You might have to use sudo here, if you're on windows maybe not.
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
9 Run phpunit -h
在命令行上,你应该得到一些帮助信息。如果您在 Windows 上,您可能必须在尝试之前打开一个新的命令行提示符。