0

I've just used yiic for the first time for a plugin record installation and found that the db.php config file didn't seem to be picked up and I got database connection failures.

I added a console array to the file to try that but still no joy. So I edited the craft/app/etc/config/defaults/db.php with the username, password, table prefix and database name of my local install and it all works fine.

I've not tried this on a vanilla Craft install but I'm guessing that this may be because my config directory has been renamed to config-mydomainname as we are running 2 craft sites off of one craft instance.

That works by way of the following in the ./public_html/index.php file:

define('CRAFT_CONFIG_PATH', '../craft/config-mydomainname/');

Is this change of path causing the issue with the console?

1
  • i had a similar issue with trying to nominate the target config (dev, staging, live) for yiic console plugins - instead of hacking yiic.php i wrote a simple, generalised front-end php script, which you might be able to adapt to your particular problem. see here craftcms.stackexchange.com/questions/10725/… – bhu Boue vidya May 14 '16 at 20:16
1

I ran into something very similar to this today. I have a custom path for plugins, as a result I could no longer run the plugin console commands because yiic.php is looking in the default path as specified by its defines. You need to let yiic.php know about your custom paths and unfortunately I don't think this is possible at the moment without hacking it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.