<p>You should almost never have to change these from the default settings.</p>

<p>All you need to do is make sure your webserver points to your server root properly (in your case, <code>/home/xxx/public_html/web/</code>)</p>

<p>The default Craft 3 install has <code>web/</code> as the server root, with Craft and all of it's files/folders in the root directory. If you don't change anything, the <code>index.php</code> that ships with Craft will "just work" once you've pointed the webserver at the web root.</p>

<p>In your case, it sounds like you're saying that you've moved all of Craft into a <code>craft/</code> directory that sits alongside the <code>web/</code> directory. Assuming you've moved <em>everything</em> into that folder, you'd do something like this in your <code>index.php</code>:</p>

<pre><code>// Project root path
$root = dirname(__DIR__).'/craft';
</code></pre>

CC BY-SA 3.0
2018-02-02T15:14:59.670Z
2018-02-02T15:14:59.670Z
andrew.welch
<p>I am struggling with the definition of CRAFT_BASE_PATH and CRAFT_VENDOR_PATH in web/index.php:</p>

<p>My absolute URLs are as follows:</p>

<p>/home/xxx/public_html/craft/ (not publicly accessible)</p>

<p>and</p>

<p>home/xxx/public_html/web/ (publicly accessible)</p>

<p>Thank you very much for your help!</p>

<config><craft3>
Craft 3: Struggling with CRAFT_BASE_PATH and CRAFT_VENDOR_PATH
# Craft 3: Struggling with CRAFT_BASE_PATH and CRAFT_VENDOR_PATH

(Asked by: username_0 on 2018-02-02)

I am struggling with the definition of CRAFT\_BASE\_PATH and CRAFT\_VENDOR\_PATH in web/index.php:

My absolute URLs are as follows:

/home/xxx/public\_html/craft/ (not publicly accessible)

and

home/xxx/public\_html/web/ (publicly accessible)

Thank you very much for your help!

**Tags:** config, craft3

---

## 1 answers

### Answer by username_1 on 2018-02-02. Score: 3 | Accepted answer

You should almost never have to change these from the default settings.
All you need to do is make sure your webserver points to your server root properly (in your case, /home/xxx/public_html/web/)
The default Craft 3 install has web/ as the server root, with Craft and all of it's files/folders in the root directory. If you don't change anything, the index.php that ships with Craft will "just work" once you've pointed the webserver at the web root.
In your case, it sounds like you're saying that you've moved all of Craft into a craft/ directory that sits alongside the web/ directory. Assuming you've moved everything into that folder, you'd do something like this in your index.php:
// Project root path
$root = dirname(__DIR__).'/craft';


---

