# Need an help on cake bake

**URL:** <https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401>\
**Category:** Need Help\
**Created:** [July 22, 2019, 5:47pm UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401 "2019-07-22T17:47:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilio](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@emilio](https://discourse.cakephp.org/u/emilio)\
**Post date:** [July 22, 2019, 5:47pm UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/1 "2019-07-22T17:47:57Z")

</div>

I installed PHP CLI (7.2) then I installed bake plugin by composer. In my root/bin have 3 files cake, cake.bat and cake.php.  
If I run cake bake terminal echo

```
Command 'cake' not found, did you mean:

  command 'rake' from snap ruby (2.5.3)
  command 'cmake' from deb cmake
  command 'chake' from deb chake
  command 'rake' from deb rake
  command 'fake' from deb fake
  command 'care' from deb care
  command 'jake' from deb node-jake
  command 'make' from deb make
  command 'make' from deb make-guile

See 'snap info <snapname>' for additional versions.
```

If i run php cli in root/bin this is the message

```
**emilio@emilio-System-Product-Name** : **/var/www/html/foods\_chile/bin** $ php cake bake
################################################################################
#
# Cake is a shell script for invoking CakePHP shell commands
#
# CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
# @link https://cakephp.org CakePHP(tm) Project
# @since 1.2.0
# @license https://opensource.org/licenses/mit-license.php MIT License
#
################################################################################

# Canonicalize by following every symlink of the given name recursively
canonicalize() {
    NAME="$1"
    if [-f "$NAME"]
    then
        DIR=$(dirname -- "$NAME")
        NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
    fi
    while [-h "$NAME"]; do
        DIR=$(dirname -- "$NAME")
        SYM=$(readlink "$NAME")
        NAME=$(cd "$DIR" > /dev/null && cd "$(dirname -- "$SYM")" > /dev/null && pwd)/$(basename -- "$SYM")
    done
    echo "$NAME"
}

# Find a CLI version of PHP
findCliPhp() {
    for TESTEXEC in php php-cli /usr/local/bin/php
    do
        SAPI=$(echo "cli" | $TESTEXEC 2>/dev/null)
        if ["$SAPI" = "cli"]
        then
            echo $TESTEXEC
            return
        fi
    done
    echo "Failed to find a CLI version of PHP; falling back to system standard php executable" >&2
    echo "php";
}

# If current path is a symlink, resolve to real path
realname="$0"
if [-L "$realname"] 
then
	realname=$(readlink -f "$0")
fi

CONSOLE=$(dirname -- "$(canonicalize "$realname")")
APP=$(dirname "$CONSOLE")

# If your CLI PHP is somewhere that this doesn't find, you can define a PHP environment
# variable with the correct path in it.
if [-z "$PHP"]
then
    PHP=$(findCliPhp)
fi

if ["$(basename "$realname")" != 'cake']
then
    exec "$PHP" "$CONSOLE"/cake.php "$(basename "$realname")" "$@"
else
    exec "$PHP" "$CONSOLE"/cake.php "$@"
fi

exit
```

Where am I wrong?  
Thank in advance

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [July 22, 2019, 9:23pm UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/2 "2019-07-22T21:23:11Z")

</div>

`bin/cake` is a shell script, not PHP code. You should typically invoke it as `bin/cake bake` from the Cake root folder.

---

<div class="post-metadata">

**Author:** ![emilio](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@emilio](https://discourse.cakephp.org/u/emilio)\
**Post date:** [July 22, 2019, 11:29pm UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/3 "2019-07-22T23:29:09Z")

</div>

I know, but with command cake bake doesn’t work and seems plugin isn’t in my project

---

<div class="post-metadata">

**Author:** ![karmicdice](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/karmicdice/32/1298_2.png) [@karmicdice](https://discourse.cakephp.org/u/karmicdice)\
**Post date:** [July 23, 2019, 3:46am UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/4 "2019-07-23T03:46:12Z")

</div>

Add a `./`  
So your command screen should look like:

```bash
/var/www/html/foods_chile/bin$ ./cake bake

```

---

<div class="post-metadata">

**Author:** ![emilio](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@emilio](https://discourse.cakephp.org/u/emilio)\
**Post date:** [July 23, 2019, 6:06am UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/5 "2019-07-23T06:06:54Z")

</div>

Thank You for your help but it is the result (maybe I am still wrong)  
emilio@emilio-System-Product-Name:/var/www/html/foods\_chile$ bin$ ./cake bake

Command ‘bin$’ not found, did you mean:

command ‘bino’ from deb bino  
command ‘bing’ from deb bing

Try: sudo apt install

I forgot to say I am using Ubuntu 18.04 and cakephp rel 3.8, php 7.2.19

---

<div class="post-metadata">

**Author:** ![emilio](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@emilio](https://discourse.cakephp.org/u/emilio)\
**Post date:** [July 23, 2019, 6:11am UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/6 "2019-07-23T06:11:12Z")

</div>

Thank You very much, now it works, U were very gentle

---

<div class="post-metadata">

**Author:** ![karmicdice](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/karmicdice/32/1298_2.png) [@karmicdice](https://discourse.cakephp.org/u/karmicdice)\
**Post date:** [July 23, 2019, 6:25am UTC](https://discourse.cakephp.org/t/need-an-help-on-cake-bake/6401/7 "2019-07-23T06:25:16Z")

</div>

Glad it helped 🙂
