How to check Cakephp version from command line?

12,545

Solution 1

According to their documentation for version 3.x , this is how you can do this. Shells, Tasks & Console Tools

In which they have mentioned to go to directory first using command line tool and then by typing bin/cake Something like this

cd /path/to/app
bin/cake

And in response you will be able to see not only CakePHP's current version but also PHP's current version and few more information.

Welcome to CakePHP v3.0.0 Console
---------------------------------------------------------------
App : App
Path: /Users/markstory/Sites/cakephp-app/src/
---------------------------------------------------------------
Current Paths:

 -app: src
 -root: /Users/markstory/Sites/cakephp-app
 -core: /Users/markstory/Sites/cakephp-app/vendor/cakephp/cakephp

Changing Paths:

Your working path should be the same as your application path. To change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:

[Bake] bake

[Migrations] migrations

[CORE] i18n, orm_cache, plugin, routes, server

[app] behavior_time, console, orm

To run an app or core command, type cake shell_name [args]
To run a plugin command, type cake Plugin.shell_name [args]
To get help on a specific command, type cake shell_name --help

Also I am not so sure this will work for older version than CakePHP 3.x as I have tried this in version 3.x only.. so please take a note on that too.

Solution 2

Because it doens't show the version when simply typing bin/cake in the project forlder, I also recommend this approach:

  1. Browse to your project forlder
  2. continue browsing to the bin forlder ( cd bin)
  3. then type cake version

That works for me and it shown 3.5.6

Also I recommend including PHP in the system or user path if so you can type php -version anywhere in the prompt to get your php version.

Share:
12,545
Mittul At TechnoBrave
Author by

Mittul At TechnoBrave

Just some things that I have noticed here and trying to learn: Never down vote other user's post. Just comment about it or flag it. Be kind. No one is an expert in everything. Answering first is not always the best way, quality ones beat them all. Answering in a way which is useful for all future readers and newbies. Never miss an opportunity to edit the spelling, grammar or formatting of a post. People don't search for wrongly spelled keywords and it also improves user's chance to get an answer. The whole point of Stack Overflow was contribution and not competition. Unfortunately, we follow the latter. And yea, remember that this user rocks and is one of the best persons on earth :)

Updated on June 05, 2022

Comments

  • Mittul At TechnoBrave
    Mittul At TechnoBrave almost 2 years

    I am using Cakephp 3.x but i want to know the exact version number using command line ? is there any command available which can show us the correct version which we are using in our application ?

    i know we can use this echo Configure::version(); to check version using code, i was just curious to know if i can come to know the same thing using command line interface only..

    FYI, i have windows 7 as OS, xampp as server with composer and other stuff installed in my cakephp application ..

    Command for any OS (ubuntu,windows) will be welcomed to come to know about it ..

    Thanks