【问题标题】:Using composer.phar on wamp64 cakephp3 upgrade在 wamp64 cakephp3 升级上使用 composer.phar
【发布时间】:2017-12-17 14:05:57
【问题描述】:

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

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

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
}

【问题讨论】:

  • 先尝试更新作曲家php composer.phar update
  • 嗯,文件存在吗?
  • 我有一个名为 composer.json 的文件,如上所述。在 Windows 中,您显然不使用该命令 php composer.phar require "cakephp/cakephp:3.4.*"

标签: cakephp cakephp-3.0


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

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

    composer 需要 --update-with-dependencies "cakephp/cakephp:3.7.*"

    【讨论】:

      猜你喜欢
      • 2018-12-16
      • 2016-10-19
      • 1970-01-01
      • 2015-08-30
      • 2014-09-03
      • 2013-08-08
      • 2018-12-17
      • 2019-01-30
      • 2015-06-01
      相关资源
      最近更新 更多