无法使用cakePhp 3.2进行烘焙

无法使用cakePhp 3.2进行烘焙,php,cakephp,cygwin,cakephp-bake,cakephp-3.2,Php,Cakephp,Cygwin,Cakephp Bake,Cakephp 3.2,我正在尝试在wamp本地服务器上使用cakephp 3.2创建新的本地项目。我用composer安装了它 安装后,一切似乎都正常:我在app.php上配置了我的db访问权限,cakephp默认主页确认配置一切正常(php版本和扩展正常/写入权限正常/连接到db正常) 但当我尝试使用bake命令(从我的项目根目录)时,出现了一个错误: $ bin/cake bake Could not open input file: /cygdrive/c/wamp64/www/cemafor/bin/cake

我正在尝试在wamp本地服务器上使用cakephp 3.2创建新的本地项目。我用composer安装了它

安装后,一切似乎都正常:我在app.php上配置了我的db访问权限,cakephp默认主页确认配置一切正常(php版本和扩展正常/写入权限正常/连接到db正常)

但当我尝试使用bake命令(从我的项目根目录)时,出现了一个错误:

$ bin/cake bake
Could not open input file: /cygdrive/c/wamp64/www/cemafor/bin/cake.php
但是,文件c/wamp64/www/cemafor/bin/cake.php存在

我尝试使用“/bin/cake bake”命令(根据),仍然出现相同的错误

尝试删除并重新安装项目,无需更改

我看到安装的烘焙版本是1.2.1(请参阅install命令的结果)。我查看了/composer.json文件,看到了以下内容:

"require-dev": {
    "psy/psysh": "@stable",
    "cakephp/debug_kit": "~3.2",
    "cakephp/bake": "~1.1"
},
因此,我尝试通过以下方式更改cakephp/bake版本的版本值:

"cakephp/bake": "~1.2"
但这不会改变任何事情

我尝试根据安装版本1.0,但不起作用

找不到一个人有同样的问题。。。和一只愚蠢的虫子在一起时感到孤独^^

非常感谢您的帮助


有关信息,请参见instal命令的结果:

$ composer create-project --prefer-dist cakephp/app cemafor
Installing cakephp/app (3.2.1)
  - Installing cakephp/app (3.2.1)
    Loading from cache

Created project in cemafor
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing aura/installer-default (1.0.0)
    Loading from cache

  - Installing cakephp/plugin-installer (0.0.12)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing mobiledetect/mobiledetectlib (2.8.19)
    Loading from cache

  - Installing aura/intl (1.1.1)
    Loading from cache

  - Installing cakephp/chronos (0.4.7)
    Loading from cache

  - Installing cakephp/cakephp (3.2.3)
    Loading from cache

  - Installing symfony/yaml (v3.0.3)
    Loading from cache

  - Installing symfony/filesystem (v3.0.3)
    Loading from cache

  - Installing symfony/config (v3.0.3)
    Loading from cache

  - Installing symfony/polyfill-mbstring (v1.1.0)
    Loading from cache

  - Installing symfony/console (v3.0.3)
    Loading from cache

  - Installing robmorgan/phinx (v0.5.1)
    Loading from cache

  - Installing cakephp/migrations (1.5.6)
    Loading from cache

  - Installing jakub-onderka/php-console-color (0.1)
    Loading from cache

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Loading from cache

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Loading from cache

  - Installing nikic/php-parser (v2.0.1)
    Loading from cache

  - Installing symfony/var-dumper (v3.0.3)
    Loading from cache

  - Installing psy/psysh (v0.7.1)
    Loading from cache

  - Installing jdorn/sql-formatter (v1.2.17)
    Loading from cache

  - Installing cakephp/debug_kit (3.2.6)
    Loading from cache

  - Installing cakephp/bake (1.2.1)
    Loading from cache

symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
symfony/var-dumper suggests installing ext-symfony_debug ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
cakephp/debug_kit suggests installing ext-sqlite (DebugKit needs to store panel data in a database. SQLite is simple and easy to use.)
Writing lock file
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
> App\Console\Installer::postInstall
Created `config/app.php` file
Set Folder Permissions ? (Default to Y) [Y,n]? Y
Updated Security.salt value in config/app.php
{
    "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.2"
    },
    "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-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}
这是我的composer.json内容

$ composer create-project --prefer-dist cakephp/app cemafor
Installing cakephp/app (3.2.1)
  - Installing cakephp/app (3.2.1)
    Loading from cache

Created project in cemafor
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing aura/installer-default (1.0.0)
    Loading from cache

  - Installing cakephp/plugin-installer (0.0.12)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing mobiledetect/mobiledetectlib (2.8.19)
    Loading from cache

  - Installing aura/intl (1.1.1)
    Loading from cache

  - Installing cakephp/chronos (0.4.7)
    Loading from cache

  - Installing cakephp/cakephp (3.2.3)
    Loading from cache

  - Installing symfony/yaml (v3.0.3)
    Loading from cache

  - Installing symfony/filesystem (v3.0.3)
    Loading from cache

  - Installing symfony/config (v3.0.3)
    Loading from cache

  - Installing symfony/polyfill-mbstring (v1.1.0)
    Loading from cache

  - Installing symfony/console (v3.0.3)
    Loading from cache

  - Installing robmorgan/phinx (v0.5.1)
    Loading from cache

  - Installing cakephp/migrations (1.5.6)
    Loading from cache

  - Installing jakub-onderka/php-console-color (0.1)
    Loading from cache

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Loading from cache

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Loading from cache

  - Installing nikic/php-parser (v2.0.1)
    Loading from cache

  - Installing symfony/var-dumper (v3.0.3)
    Loading from cache

  - Installing psy/psysh (v0.7.1)
    Loading from cache

  - Installing jdorn/sql-formatter (v1.2.17)
    Loading from cache

  - Installing cakephp/debug_kit (3.2.6)
    Loading from cache

  - Installing cakephp/bake (1.2.1)
    Loading from cache

symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
symfony/var-dumper suggests installing ext-symfony_debug ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
cakephp/debug_kit suggests installing ext-sqlite (DebugKit needs to store panel data in a database. SQLite is simple and easy to use.)
Writing lock file
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
> App\Console\Installer::postInstall
Created `config/app.php` file
Set Folder Permissions ? (Default to Y) [Y,n]? Y
Updated Security.salt value in config/app.php
{
    "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.2"
    },
    "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-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}
终于成功了! …强烈地帮助补偿无能^^

我在这里遵循以下步骤:

在第4步中,当我编辑/bin/php文件(在我的例子中是notepadd++中)时,我要做两个小操作以使其正常工作:

  • 将文档转换为UNIX格式
  • 在UTF8上编码(无BOM)
这次一切正常

很高兴终于被阿贝尔解决了这个问题。
非常感谢。

权限?确保允许您使用的用户执行文件。我使用的是带Powershell的bake-on-windows,而不是cygwin的bash。@burzum提到的权限是一种可能性。另一个原因是系统没有关于其所有路径的正确信息。有哪些相关路径,它们在哪些环境变量中是预期的?
bake
真的在找正确的地方吗?正如burzum所建议的,我尝试使用windows invit命令,这次它可以工作了。。。这意味着这是一个权限问题?但我希望它能和cygwin一起使用,因为我更喜欢使用它。我应该如何解决这些权限问题?谢谢大概不确定这是否仍然适用。谢谢你的回答!我看过ndm给出的链接,但不幸的是,我似乎没有能力处理给定的解决方案。。。(例如,不知道如何做:“在您的bash配置文件或bashrc或其他任何文件上创建别名composer='composer.bat');这位作曲家为我写的《西温》写得很好。我还要做一些其他的搜索。。如果我能找到一个可以应用的解决方案,我会在这里发布。非常感谢您与我们分享您的知识。