如何使用wamp在netbeans 7.1.1中为zend framework 1.11.11设置开发环境?

时间:2012-04-27 14:34:50

标签: php mysql apache zend-framework netbeans

嘿伙计们,我需要你帮助设置zendframe工作的环境吗?我在D:/ program files / netbeans下的D:驱动器中安装了我的netbeans。并且zend框架在D:驱动下。我的wamp包安装在c:/ wamp下。现在我需要的是为我的开发配置这些全部?

我搜索了google,stackoverflow和我可以整天的每个博客。但我得到的只是下面给出的错误。

'“php.exe”'无法识别为内部或外部命令, 可操作程序或批处理文件。

告诉我怎么解决这个问题?我该怎么办 ?我是否需要在一个屋檐下设置所有这些或者我需要升级我的PHP版本???

是我的配置如下。

WAMP Server 2.0c,PHP 5.2.6,MySQL 5.0.51b,Apache 2.2.8。

Netbeans 7.1.1和Zend framework 1.11.11

3 个答案:

答案 0 :(得分:3)

将php.exe添加到您的环境变量PATH中。如果将安装了php.exe的目录添加到PATH环境变量中(您可能需要注销才能使其生效),它应该可以正常工作。

See this tutorial

答案 1 :(得分:1)

您实际上可以在Options - PHP - General标签中指定Netbeans中PHP解释器的路径。

也许您应该设置include_path以使Zend模块(至少自动加载一个)可识别。

答案 2 :(得分:1)

首先更新到更新版本的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.

  1. Open up a command prompt

  2. Open a browser window.

  3. In your browser go to http://pear.php.net/go-pear

  4. Save the text file that comes up into the directory php is installed in.

  5. Go to the php directory php is installed in via the cd command on the terminal.

  6. Type in the command php go-pear.phar

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

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

php go-pear.phar来安装它,您应该收到一些帮助消息。如果你在Windows上,你可能需要在尝试之前打开一个新的命令行提示符。