dsa88886666
2014-05-08 06:26
浏览 41
已采纳

如何在Ubuntu上安装zend框架?

I want to install zend framework on the Ubuntu and i have followed the instruction of installation from http://framework.zend.com/manual/2.2/en/user-guide/skeleton-application.html link but failed to install.

I have downloaded the ZendSkeletonApplication from here https://github.com/zendframework/ZendSkeletonApplication

After that run of this command

php composer.phar self-update   // it's working

But after the first command the second Command

php composer.phar install   // Not working

And showing this error

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

 Problem 1
- zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found.
- zendframework/zendframework 2.3.0 requires php >=5.3.23 -> no matching package found.
- Installation request for zendframework/zendframework 2.3.* -> satisfiable by zendframework/zendframework[2.3.0, 2.3.1].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Update after some comments:

Now I've downloaded the ZendSkeletonApplication-master and move the

Library folder of ZendFramework-2.3.1

in the

ZendSkeletonApplication-master/vendor/ZF2/

But after that when i access this i'm getting this error on the page

ZendSkeletonApplication-master/public/index.php // in the browser it showing me this error

Fatal error: Declaration of Zend\Stdlib\ArrayObject::offsetGet() must be compatible with
that of ArrayAccess::offsetGet() in /var/www/html/demo/username/ZendSkeletonApplication
-master/vendor/ZF2/library/Zend/Stdlib/ArrayObject.php on line 22
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • doublel83422 2014-05-08 07:27
    已采纳

    Well two solutions are possible :

    First upgrade php, However it could be possible that Ubuntu release on your system not having upgrades for php. So in that case search google to add APT repository for php 5.3.23 for your ubuntu-VERSION.

    Second I personally experienced that, Checkout in folder you will found composer.json file, In that file you will get the settings something like

    "require": {
        "php": ">=5.3.23",
        "zendframework/zendframework": "2.3.*"
    }
    

    Just change settings to get other version of ZF2

    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.2.*"
    }
    

    It works for me. It should work for you.

    打赏 评论
  • douzi5214 2014-05-08 06:54

    Read the error, the main thing we need to focus on is this: zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found.

    I'll break it down for you.

    This states that the package you are attempting to install(zendframework/zendframework 2.3.1) REQUIRES a php version GREATER OR EQUAL TO 5.3.23. As your php -v output stated, you are running PHP 5.3.10. If you are running on a local server that you have access to updating the php version, then update php and run it again, you should see that it works fine. If you are on a remote server, contact your hosting company and see if they can upgrade you to a newer version of php and then run it again!

    Hope this helps!

    打赏 评论
  • doushuichong2589 2014-08-08 20:10

    If you have more then one version of php installed and you have php environment variable linking to an old php executable then you may get this issue. Change your environment variable to the php you want to use.

    打赏 评论

相关推荐 更多相似问题