Search code examples
phpsymfonyzend-frameworkcomposer-php

Missing composer/zend command: development-enable


When I install Zend via composer create-project -n -sdev zendframework/skeleton-application as specified by Zend's main tutorial, I get a skeleton application that seems to work nicely.

However, when I follow this tutorial's advice to use composer development-enable, I get the following message:

[Symfony\Component\Console\Exception\CommandNotFoundException]  
Command "development-enable" is not defined. 

Is anyone able to duplicate/fix this problem?

I would normally assume it's an issue with the bash $PATH value, but the composer command by itself runs just fine, so I'm thinking it may be some other problem specific to this subcommand -- a missing dependency somewhere, for example.

Here is the relevant piece of the tutorial I am trying to follow:

https://docs.zendframework.com/tutorials/getting-started/skeleton-application/

(In case it helps for purposes of duplication: The CLI PHP version on my development server is 5.4.43. For reasons I won't bore you with, I can't update this CLI PHP to a newer version; the major release that Apache is using on my machine is 5.6.)


EDIT 1: Rerunning my installation using composer create-project -s dev zendframework/skeleton-application (as specified in the linked tutorial) still results in the same problem.


EDIT 2: Here is my shell input/output.

patrick [~/www/berlin-data]# composer create-project -n -sdev zendframework/skeleton-application
Installing zendframework/skeleton-application (2.3.3)
  - Installing zendframework/skeleton-application (2.3.3)
    Loading from cache

Created project in /home1/patrick/public_html/berlin-data/skeleton-application
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing zendframework/zendxml (1.0.2)
    Loading from cache

  - Installing zendframework/zendframework (2.3.3)
    Loading from cache

zendframework/zendframework suggests installing doctrine/annotations (Doctrine Annotations >=1.0 for annotation features)
zendframework/zendframework suggests installing ircmaxell/random-lib (Fallback random byte generator for Zend\Math\Rand if OpenSSL/Mcrypt extensions are unavailable)
zendframework/zendframework suggests installing ocramius/proxy-manager (ProxyManager 0.5.* to handle lazy initialization of services)
zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
Writing lock file
Generating autoload files


patrick [~/www/berlin-data]# cd skeleton-application/

patrick [~/www/berlin-data/skeleton-application]# composer development-enable

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "development-enable" is not defined.

Solution

  • When you run the command

    composer create-project -n -sdev zendframework/skeleton-application
    

    This will create a directory in your current dir called skeleton-application inside of this directory is where you need to run the command:

    composer development-enable
    

    If this still doesnt work then something went wrong with install process.

    The first command should give out put something like:

    $ composer create-project -n -sdev zendframework/skeleton-application
    Installing zendframework/skeleton-application (dev-master 941da45b407e4f09e264f0                                             00fb537928badb96ed)
      - Installing zendframework/skeleton-application (dev-master master)
        Cloning master from cache
    
    Created project in C:\Users\<UserName>\Documents\skeleton-application
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
      - Installing zendframework/zend-component-installer (0.3.0)
        Downloading: 100%
    
      - Installing zendframework/zend-stdlib (3.0.1)
        Downloading: 100%
    ...
    

    Notice this line Created project in C:\Users\<UserName>\Documents\skeleton-application

    Thats the directory you need to be in to run the command:

    cd C:\Users\<UserName>\Documents\skeleton-application
    composer development-enable
    

    If that still didnt work, try specifying the version for downloading:

    composer create-project -n "zendframework/skeleton-application":"dev-master"
    

    PS

    As of writing this the skeleton application requires PHP "^5.6 || ^7.0". So if you are running a lower version composer wont install that copy. And the tutorials based on it may not work as expected.