1. Reference URL: https://book.cakephp.org/2/en/console-and-shells.html . Create a simple Hello world shell. In the application’s Console/Command directory, create HelloShell.php.
PHP
<?php
/**
* Created by PhpStorm.
* User: Qiang Wang
* Date: 2020/08/18
* Time: 15:04
*/
class HelloShell extends AppShell {
public function main() {
$this->out('Hello world.');
}
}2. Navigate to the directory: E:\wwwroot\creditshop\app\Console, and run: ./cake hello. It throws an error: Error Shell class HelloShell could not be found. As shown in Figure 1

Plaintext
PS E:\wwwroot\creditshop\app\Console> ./cake hello
Error: Shell class HelloShell could not be found.
#0 E:\wwwroot\creditshop\lib\Cake\Console\ShellDispatcher.php(200): ShellDispatcher->_getShell('hello')
#1 E:\wwwroot\creditshop\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#2 E:\wwwroot\creditshop\app\Console\cake.php(47): ShellDispatcher::run(Array)
#3 {main}
3. Reference URL: https://stackoverflow.com/questions/10671634/cakephp-shell-shell-class-helloshell-could-not-be-found , as shown in Figure 2

4. Navigate to the directory: E:\wwwroot\creditshop\app, and run: Console/cake hello. No more errors occur. As shown in Figure 3

Plaintext
PS E:\wwwroot\creditshop\app> Console/cake hello
Welcome to CakePHP v2.6.4 Console
---------------------------------------------------------------
App : app
Path: E:\wwwroot\creditshop\app\
---------------------------------------------------------------
Hello world.
