<p>If you upload Craft, your folder structure should look like this (default):</p>

<blockquote>
  <p>/craft/..<br>
  /public/index.php</p>
</blockquote>

<p>If this is not the case, you have to set <code>$craftPath</code> (in the index.php) depending on your folder structure. Check out the <a href="http://buildwithcraft.com/docs/installing#step-1-upload-the-files" rel="nofollow">Installing</a> section in the docs.</p>

<p>.</p>

<p><strong>Example:</strong></p>

<p>If your structure looks like this..</p>

<blockquote>
  <p>/craft/..<br>
  /index.php</p>
</blockquote>

<p>..the path should be: <code>$craftPath = './craft';</code></p>

CC BY-SA 3.0
2014-06-26T22:09:02.627Z
We've also seen this happen, even if everything appears to be setup correctly, because the host has some PHP open_basedir restrictions in place that won't allow Craft to find the craft/ folder.
Brad Bell
CC BY-SA 3.0
2014-06-26T21:55:59.723Z
2014-06-26T21:55:59.723Z
Victor
<p>I had this issue on my VPS and found out it was due to permissions. I had to chown the craft folder to the Apache group (for Ubuntu, its www-data):</p>

<pre><code>sudo chown -R sudo_user:www-data /var/www/craft
</code></pre>

<p>Replace "sudo_user" with your user, and /var/www/craft to the full path of your craft folder.</p>

CC BY-SA 3.0
2014-12-30T14:29:17.330Z
2014-12-30T14:29:17.330Z
Brian Saycocie
<p>Just wanted to add on to <a href="https://craftcms.stackexchange.com/a/5432/45">Brian's post</a> about permissions, for future users who are having a similar issue and stumble across this answer. I was running into similar problems locally using MAMP, and found the Apache group for OS X is _www. Once I did the command </p>

<pre><code>sudo chown -R sudo_user:_www /Sites/craft
</code></pre>

<p>everything loaded as expected. Obviously the "Sites/craft" directory is my own path. Yours will probably be different.</p>

CC BY-SA 3.0
2015-03-19T14:37:36.623Z
2015-03-19T22:44:04.433Z
2017-04-13T12:51:00.160Z
Shad
<p>I have a Craft site that works great locally, but I can't get it running on a staging server. The virtual host is working and when I remove code from <code>index.php</code> in html it runs perfectly. Here is the error...</p>

<blockquote>
  <p>Could not find your craft/ folder. Please ensure that $craftPath is set correctly in /var/www/vhosts/testsite/staging/html/index.php</p>
</blockquote>

<p>I've seen the error reported online but no solutions, any ideas?</p>

CC BY-SA 3.0
2014-06-26T21:55:46.730Z
What is $craftPath set to in index.php? Where is your Craft folder relative to web root?
Simon Kuran
CC BY-SA 3.0
2014-06-27T01:05:06.067Z
@EricCallan What do you mean when you say that you "remove code from index.php in html and it runs perfectly"? That flat files and anything not referencing the Craft folder behave normally?
Matt Stein
CC BY-SA 3.0
2014-06-27T13:20:33.090Z
If I just echo out "hello"
eric MC
<config><server><php>
Can't get Craft running on a remote server
# Can't get Craft running on a remote server

(Asked by: username_0 on 2014-06-26)

I have a Craft site that works great locally, but I can't get it running on a staging server. The virtual host is working and when I remove code from `index.php` in html it runs perfectly. Here is the error...

> Could not find your craft/ folder. Please ensure that $craftPath is set correctly in /var/www/vhosts/testsite/staging/html/index.php

I've seen the error reported online but no solutions, any ideas?

**Tags:** config, server, php

> **Comments:**
> **username_1**: What is $craftPath set to in index.php? Where is your Craft folder relative to web root?  
> **username_2**: @EricCallan What do you mean when you say that you "remove code from index.php in html and it runs perfectly"? That flat files and anything not referencing the Craft folder behave normally?  
> **username_0**: If I just echo out "hello"  

---

## 3 answers

### Answer by username_3 on 2014-06-26. Score: 3

If you upload Craft, your folder structure should look like this (default):

> /craft/..  
> /public/index.php

If this is not the case, you have to set `$craftPath` (in the index.php) depending on your folder structure. Check out the [Installing](http://buildwithcraft.com/docs/installing#step-1-upload-the-files) section in the docs.

.

**Example:**

If your structure looks like this..

> /craft/..  
> /index.php

..the path should be: `$craftPath = './craft';`

> **Comments:**
> **username_4**: We've also seen this happen, even if everything appears to be setup correctly, because the host has some PHP open_basedir restrictions in place that won't allow Craft to find the craft/ folder.  

---

### Answer by username_5 on 2014-12-30. Score: 2

I had this issue on my VPS and found out it was due to permissions. I had to chown the craft folder to the Apache group (for Ubuntu, its www-data):
sudo chown -R sudo_user:www-data /var/www/craft

Replace "sudo_user" with your user, and /var/www/craft to the full path of your craft folder.


---

### Answer by username_6 on 2015-03-19. Score: 2

Just wanted to add on to Brian's post about permissions, for future users who are having a similar issue and stumble across this answer. I was running into similar problems locally using MAMP, and found the Apache group for OS X is _www. Once I did the command 
sudo chown -R sudo_user:_www /Sites/craft

everything loaded as expected. Obviously the "Sites/craft" directory is my own path. Yours will probably be different.


---

