du6jws6975
du6jws6975
2014-05-03 05:49

通过Composer安装ZF2获取错误的PHP版本

已采纳

I have to install ZF2 on Windows:

  1. I've clone ZendSkeletonApplication (ZSA) repository from Git
  2. Open cmd and get in ZSA folder
  3. run php composer.phar self-update (everything is ok)
  4. run php composer.phar install

And now I get this:

zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found.

Okay, I've checked php version php -v:

PHP 5.3.6 (cli) (built: Mar 17 2011 10:37:07)

Any ideas?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • duangan4070 duangan4070 7年前

    ZF 2.3.0 and above requires PHP 5.3.23 or above. You have 5.3.6 (6 is less than 23!). You either need to upgrade PHP to a more recent version, or downgrade to ZF 2.2.x.

    点赞 评论 复制链接分享
  • drcomwc134525 drcomwc134525 7年前

    I suggest you update your local Windows version of PHP to the version you are using in production. If that production version is not able to run Zend Framework 2.3.1, you'd not benefit from solving the dependency problem you are experiencing.

    Composer does not allow you to change the internally used PHP version if your local PHP is simply used to put together all dependencies but to used to execute these. So matching the production version is a good thing.

    点赞 评论 复制链接分享
  • dparivln22034 dparivln22034 7年前

    5.3.6 is less than 5.3.23. >= means "greather than or equal to".

    Zend Framework 2 requires at least 5.3.23, while you have 5.3.6. That means your PHP version is not supported, you can't use the Zend Framework on that server.

    What you can do:

    • Update PHP version to something newer (5.3 is getting pretty old)
    • If you are sure you already have a newer PHP version installed, check that the cmd is using the new PHP binary and not the old one.
    点赞 评论 复制链接分享

相关推荐