2

I'm trying to create new local project with cakephp 3.2, following the cakephp doc, on wamp local server. I used composer to install it.

Everythings seems ok after installation : I configure my db access on app.php and the cakephp default homepage confirms that everything is OK with the configuration (PHP version & extensions OK / write rights OK / connect to db OK)

But when I try to use bake commands (from my project root directory), I've got an error :

$ bin/cake bake
Could not open input file: /cygdrive/c/wamp64/www/cemafor/bin/cake.php

However, the file c/wamp64/www/cemafor/bin/cake.php exists !

I try to use "./bin/cake bake" command (according to cakephp bake doc recommendation), still the same error.

Try also to remove and reinstall the project, no change.

I saw the bake version installed was 1.2.1 (see the result of install command). I've looked into /composer.json file, and saw this :

"require-dev": {
    "psy/psysh": "@stable",
    "cakephp/debug_kit": "~3.2",
    "cakephp/bake": "~1.1"
},

So I try to change version value for cakephp/bake version by this :

"cakephp/bake": "~1.2"

But doesn't change anything...

I try to install version 1.0 according to bake doc but doesn't work.

And unable to find a single person having the same problem... feel alone in the world with a stupid bug ^^

Thanks a lot for your help !


For information, here is the result of the instal command :

$ 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

And here is my composer.json content :

{
    "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
}
  • Permissions? Make sure the user you're using is allowed to execute the file(s). I'm using bake on windows with the Powershell, not bash via cygwin without trouble. – floriank Mar 01 '16 at 12:47
  • Permissions as mentioned by @burzum are one possibility. An other is that the system has not the correct information about all its paths. What relevant paths are there, and in what environment variables are they expected? Is `bake` really looking at the right place? – peter_the_oak Mar 01 '16 at 12:54
  • As suggested by burzum, I try with windows invit command, and this time it works... This mean this is a permissions problem ? But I'd like it to work with cygwin, cause I really prefer use it. What should I do to solve those permissions problems ? Thanks ! – developpeuse web Mar 01 '16 at 13:06
  • 1
    **http://www.tiv.net/2014/01/could-not-open-input-file.html** maybe... not sure if this still applies. – ndm Mar 01 '16 at 15:06
  • Thanks for the answer ! I've look at the link given by ndm, but unfortunately seems I'm not competent enought to deal with the given solutions... (for ex, don't know how to do this : "Create an alias composer='composer.bat' on your bash profile or bashrc or whatever") ; and composer is working well on cygwin for me. I'm gonna make some other searches.. I'll post here if I find a solution I'm able to apply. – developpeuse web Mar 01 '16 at 15:47

1 Answers1

1

Finally succeed ! ...fiercely helps compensate incompetence ^^

I follow the steps here : https://stackoverflow.com/a/14904607/2614077.

On the step 4, when I edit /bin/php file (in notepadd++ in my case), I have 2 small operations to do to make it work :

  • convert document to a UNIX format
  • encode it on UTF8 (without BOM)

This time everything work fine.

Happy to finally been abble to solve this problem. Thanks a lot.

Community
  • 1
  • 1