doushun9875 2014-08-20 11:44
浏览 57
已采纳

使用PHPStorm 7.1.3设置Symfony2无法正常工作

I am trying to setup Symfony2 with PHPStorm 7.1.3 using these instructions but I am running into an error when i execute php app/console server:run.

The error I see is

[InvalidArgumentException]
  There are no commands defined in the "server" namespace.

enter image description here

This is what my development machine has

WAMP: 2.5
PHP : 5.5.12
OS  : Windows 7

So after getting this error I went to google to do some search and saw many people who had similar problem were using PHP 5.3 and the command line was built for PHP5.4 on wards. I then installed a new version of WAMP which came with PHP 5.5.12 assuming and hoping the error to go away and let me move on to development but then I got the same error again. Now something tells me may be I did not configure something right so I went to see the PHP settings and all seems fine to me. enter image description here

I am not sure what else to do to get it to work, I will really appreciate if anyone can guide me in setting up Symfony2 with PHPStorm.

UPDATE:

I ran a command php -v to double the php version and it says PHP 5.3.13 enter image description here

  • 写回答

1条回答 默认 最新

  • douhoujun9304 2014-08-20 13:20
    关注

    You are clearly using Terminal and not Command Line Tools (CLT). The manual you are referring to was made for older version where terminal was not yet available and it refers to CLT (which you are NOT using).

    Since you are using Terminal, make sure that your system-wide PHP is actually v5.5. You can verify this by executing php -v command.

    Terminal and "Command Line Tool Support" plugin are two different things. First is the same as your real console/terminal (e.g. cmd.exe on Windows) .. while second is some custom emulator (don't know better word/term) which can use PHP Interpreter from PhpStorm settings if configured accordingly (as per manual).


    If you want to use Command Line Tools:

    It is located at Tools | Run Command... .

    Make sure that you have created php alias (as per that manual) so it refers to currently select PHP Interpreter from IDE settings. Otherwise php command may fail. Aliases can be configured at Settings | Command Line Tool Support.


    If you want to use Terminal:

    You have 2 choices here:

    1. Use FULL path to correct php.exe instead of just php
    2. Make php v5.5 default system-wide. For this you have to:
      • Alter your PATH environment variable (My Computer | Right click | Properties | Advanced System Settings | Advanced | Environment variables...) and place folder where correct PHP 5.5 is located in front of the list
      • Restart IDE (most likely will be required) so it picks up these changes to environment variables.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测