I am running Craft 2 under MAMP (PHP 7.0.9) on windows and have a site that works under it. However if I use GIT to cd to the yiic console folder...
... and type ...
php yiic help
... I get an error message ...
Fatal error: Uncaught Error: Class 'Craft\ErrorHandler' not found in C:\MAMP\htdocs\website\craft\app\framework\YiiBase.php:213
... However, if I use PHP 5.6 (the one that I use to run the site - and which therefore has a different php.ini) I get a different message ...
exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected.
... even though the database settings must be OK as Craft works.
How do I get yiic to work?
PS: I have put some debugging into
console\yiic.php and the paths that are getting returned match what I would expect.
I have also looked at Error Connecting To (MAMP Pro) Database in Console Command but the modification it suggests to
craft/config/db.php refers to a file that does not exist: mysql.sock