<p>When diverging from Craft's default folder structure, you'll likely want to define a few of the relevant <a href="https://craftcms.com/docs/4.x/config/#php-constants" rel="nofollow noreferrer">Craft PHP constants</a>. The best place to do that, is at the top of your project's <code>bootstrap.php</code> file, which is used both when Craft is ran over HTTP (i.e. via the web root's <code>index.php</code> entry file) and when using the CLI (i.e. for console commands).</p>

CC BY-SA 4.0
2022-12-23T00:49:12.610Z
2022-12-23T00:49:12.610Z
Mats Mikkel Rummelhoff
<p>so I have Craft installed in a directory called 'cms' which is above webroot, I changed the main index file to use;</p>
<p><code>require dirname(__DIR__) . '/cms/bootstrap.php';</code></p>
<p>The main reason for this is because there's a fairly explicit open_basedir restriction on the server and we have only been allowed to have one folder added to the list (cms in this case)</p>
<p>Everything works as expected except for when we try and manage plugins through the web admin, it seems to be looking in the user root for .composer etc. when really it should be looking in ~/cms/</p>
<p>Struggling to work out where I can set this path?</p>

<composer>
Problem with composer path when installing plugins
# Problem with composer path when installing plugins

(Asked by: username_0 on 2022-12-22)

so I have Craft installed in a directory called 'cms' which is above webroot, I changed the main index file to use;

`require dirname(__DIR__) . '/cms/bootstrap.php';`

The main reason for this is because there's a fairly explicit open\_basedir restriction on the server and we have only been allowed to have one folder added to the list (cms in this case)

Everything works as expected except for when we try and manage plugins through the web admin, it seems to be looking in the user root for .composer etc. when really it should be looking in ~/cms/

Struggling to work out where I can set this path?

**Tags:** composer

---

## 1 answers

### Answer by username_1 on 2022-12-23. Score: 2

When diverging from Craft's default folder structure, you'll likely want to define a few of the relevant [Craft PHP constants](https://craftcms.com/docs/4.x/config/#php-constants). The best place to do that, is at the top of your project's `bootstrap.php` file, which is used both when Craft is ran over HTTP (i.e. via the web root's `index.php` entry file) and when using the CLI (i.e. for console commands).


---

