CommandRunner not found

Hi. I am very new to CakePHP. I run Windows 10 Pro. I installed Composer using the Windows Installer, then used Composer to install the CMS application per the instructions in the CakePHP Cookbook.

When I run the command to start the development server, I receive this error:

PHP Fatal error: Uncaught Error: Class ‘Cake\Console\CommandRunner’ not found in C:\Program Files (x86)\Ampps\www\cakePHP\cms\bin\cake.php:11
Stack trace:
#0 {main}
thrown in C:\Program Files (x86)\Ampps\www\cakePHP\cms\bin\cake.php on line 11

Line 8 reads like this:
use Cake\Console\CommandRunner;

Line 11 reads like this:
$runner = new CommandRunner(new Application(dirname(DIR) . ‘/config’), ‘cake’);

I cannot find a CommandRunner.php file in my \cms\src\Console folder. How do I install CommandRunner.php into the appropriate folder?

Thank you.

I found the answer:

composer install && composer update && composer dump-autoload --optimize

This process instructed me to edit the AMPPS php.ini file to enable the ‘intl’ extension. Once I did that, I re-ran the (above) command and my installation was appropriately updated. I then deleted the /cms folder and re-ran the command to install the CMS app (as suggested in the CakePHP Cookbook). The cake server started.

I can learn!! Thanks to anyone who took the time to read and ponder over my question.

1 Like