在wamp64 cakephp3升级上使用composer.phar

时间:2017-07-13 00:34:01

标签: cakephp cakephp-3.0

我正在使用wamp64,我想升级到cakephp3的最新稳定版本。我目前的版本是3.2.x

我从安装了cakephp应用程序名为crm的地方运行命令。我从文档中运行它,但它不起作用。

php composer.phar需要“cakephp / cakephp:3.4。*”

错误:无法打开输入文件:composer.phar 查看问题,有人可以告诉我在wamp64上运行升级的官方方法是什么?

Running Composer returns: "Could not open input file: composer.phar"

{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "http://cakephp.org",
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=5.5.9",
        "cakephp/cakephp": "~3.2",
        "mobiledetect/mobiledetectlib": "2.*",
        "cakephp/migrations": "~1.0",
        "cakephp/plugin-installer": "*"
    },
    "require-dev": {
        "psy/psysh": "@stable",
        "cakephp/debug_kit": "~3.2",
        "cakephp/bake": "~1.1"
    },
    "suggest": {
        "phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
        "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
    },
    "autoload": {
        "psr-4": {
            "App\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests",
            "Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
        "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

2 个答案:

答案 0 :(得分:0)

您需要将composer.phar文件放在运行命令的目录中。假设这是在您的代码目录中,请验证composer.phar文件是否存在。 .phar是一个php存档文件,或者为了更简单的理解,它是一个自包含的应用程序。如果该文件不存在,您将无法运行和编写器命令。

您可能需要做的就是安装composer。https://getcomposer.org/doc/00-intro.md#installation-windows

答案 1 :(得分:0)

就我而言,我也面临着同样的问题。我已经将我的项目从cakephp3.5升级到了3.7。我已经通过执行以下命令解决了该问题(要运行此命令,请确保您的作曲器已全局安装)

  

撰写者需要--update-with-dependencies“ cakephp / cakephp:3.7。*”

This is my problem and solution