<p>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 <code>yiic.php</code> is looking in the default path as specified by its defines. You need to let <code>yiic.php</code> know about your custom paths and unfortunately I don't think this is possible at the moment without hacking it.</p>

CC BY-SA 3.0
2015-12-10T09:39:13.680Z
2015-12-10T09:39:13.680Z
Fyrebase
<p>I've just used yiic for the first time for a plugin record installation and found that the <code>db.php</code> config file didn't seem to be picked up and I got database connection failures.</p>

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

<p>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 <code>config-mydomainname</code> as we are running 2 craft sites off of one craft instance.</p>

<p>That works by way of the following in the <code>./public_html/index.php</code> file:</p>

<pre><code>define('CRAFT_CONFIG_PATH', '../craft/config-mydomainname/');
</code></pre>

<p>Is this change of path causing the issue with the console?</p>

CC BY-SA 3.0
2016-05-14T20:16:15.140Z
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 http://craftcms.stackexchange.com/questions/10725/elegant-way-to-pass-configuration-to-yiic
bhu Boue vidya
<plugins><records><migration><console>
Unable to connect to db via console with a custom config directory path
# Unable to connect to db via console with a custom config directory path

(Asked by: username_0 on 2015-12-10)

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?

**Tags:** plugins, records, migration, console

> **Comments:**
> **username_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 http://craftcms.stackexchange.com/questions/10725/elegant-way-to-pass-configuration-to-yiic  

---

## 1 answers

### Answer by username_2 on 2015-12-10. Score: 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.


---

