Answers.Body: <p>If your permissions are set correctly, your php.ini is all correct, your craft folder exists and everything seems like it should work fine... Make sure you have the <code>app</code> folder inside the <code>craft</code> folder as well.</p>
  
  <p>You'll get the "Could not find your craft/ folder." if there is no app folder.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-14T03:48:57.720Z
Answers.Text: This second remark. If you are deploying with git (like I am, on Forge) of course this will happen.
Answers.UserDisplayName: David Rhoden
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T20:31:35.350Z
Answers.LastActivityDate: 2017-10-31T20:31:35.350Z
Answers.UserDisplayName: Ian
Answers.Body: <p>Then, set the correct permissions on the document root and Craft files and directories within:</p>
  
  <p>chown -R www-data:www-data /var/www</p>
  
  <p>chmod -R 770 /var/www</p>
  
  <p>chmod -R 775 /var/www/craft</p>
  
  <p>chmod -R 775 /var/www/html</p>
  
  <p>chmod 774 /var/www/craft/app</p>
  
  <p>chmod 774 /var/www/craft/config</p>
  
  <p>chmod 774 /var/www/craft/storage</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-16T08:35:01.767Z
Answers.LastActivityDate: 2017-05-16T08:35:01.767Z
Answers.UserDisplayName: sachin james
Answers.Body: <p>You can set the proper permissions for the Craft install via:</p>
  
  <p><a href="https://github.com/nystudio107/craft-scripts" rel="nofollow noreferrer">https://github.com/nystudio107/craft-scripts</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T01:50:40.570Z
Answers.LastActivityDate: 2017-04-14T01:50:40.570Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>9 times out of 10, if you're absolutely sure the path is correct, it's either a permissions issue (PHP doesn't have permissions to open the <code>craft</code> folder) or your php.ini file has  <a href="http://php.net/manual/en/ini.core.php#ini.open-basedir">open_basedir</a> restrictions in place preventing PHP from accessing the folder.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T02:49:24.573Z
Answers.Text: Ok, thanks Brad. Will double check these things.
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T02:53:15.770Z
Answers.Text: It's not open_basedir... just checked php.ini and it's commented out. How would I ensure or check if php has permissions to open the craft folder?
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T02:54:11.563Z
Answers.Text: What are the permissions on the folder and who's the user:group owner?
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:00:28.150Z
Answers.Text: Looks like 775 permission on the folder.. and I'm the owner https://www.dropbox.com/s/k3a47rq1jniszcd/Screenshot%202014-09-17%2014.59.13.png?dl=0
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:03:03.593Z
Answers.Text: What's the user:group Apache is running as? http://serverfault.com/questions/125865/finding-out-what-user-apache-is-running-as
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:07:12.563Z
Answers.Text: Ran this `ps aux | egrep '(apache|httpd)'` and got this -> https://www.dropbox.com/s/2n0h35jsp61t8ob/Screenshot%202014-09-17%2015.06.23.png?dl=0. Doesn't make a lot of sense to me but if you can make anything out that would be great. Really appreciate your help!!
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:10:34.867Z
Answers.Text: When I run `ps axo user,group,comm | grep apache` I get this https://www.dropbox.com/s/oj7ioyr36plxz6b/Screenshot%202014-09-17%2015.10.08.png?dl=0. So looks like it's running as `root`.. right?
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:12:40.007Z
Answers.Text: Hrm... looks like it's running as www-data. If you chance the permissions of the craft folder to 777 and it starts working, then that means www-data doesn't have write permissions. You can chmod -R www-data:www-data the craft folder and you should still be able to run with 775.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:14:02.853Z
Answers.Text: Yep.. that's it. Got it working running `sudo chown -R www-data:www-data htdocs`. Thanks for your help man!
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T03:15:00.090Z
Answers.Text: No problem! Now all you have to do is mark this as the answer. :)
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-17T02:40:35.713Z
Answers.LastActivityDate: 2014-09-17T02:40:35.713Z
Answers.UserDisplayName: Brad Bell
Body: <p>Trying to get my Craft site running on my server for the first time.</p>
  
  <p>Getting the error <code>Could not find your craft/ folder. Please ensure that $craftPath is set correctly in /var/www/dev.mysite.com/htdocs/public/index.php</code></p>
  
  <p>However, there is nothing different to the folder structure on my server than I have locally. 
  i.e. the <code>$craftPath</code> set in index.php is still <code>../craft</code> which is correct... my Craft folder sits beside my public folder as per default installation.</p>
  
  <p>What can I try to get this working? </p>
  
Tags: <install><server>
Title: Getting $craftPath error on server trying to get Craft running
ThreadText: # Getting $craftPath error on server trying to get Craft running
  
  (Asked by: username_0 on 2014-09-17)
  
  Trying to get my Craft site running on my server for the first time.
  
  Getting the error `Could not find your craft/ folder. Please ensure that $craftPath is set correctly in /var/www/dev.mysite.com/htdocs/public/index.php`
  
  However, there is nothing different to the folder structure on my server than I have locally.
  i.e. the `$craftPath` set in index.php is still `../craft` which is correct... my Craft folder sits beside my public folder as per default installation.
  
  What can I try to get this working?
  
  **Tags:** install, server
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_5 on 2014-09-17. Score: 8 | Accepted answer
  
  9 times out of 10, if you're absolutely sure the path is correct, it's either a permissions issue (PHP doesn't have permissions to open the `craft` folder) or your php.ini file has [open\_basedir](http://php.net/manual/en/ini.core.php#ini.open-basedir) restrictions in place preventing PHP from accessing the folder.
  
  > **Comments:**
  > **username_0**: Ok, thanks username_5. Will double check these things.  
  > **username_0**: It's not open_basedir... just checked php.ini and it's commented out. How would I ensure or check if php has permissions to open the craft folder?  
  > **username_5**: What are the permissions on the folder and who's the user:group owner?  
  > **username_0**: Looks like 775 permission on the folder.. and I'm the owner https://www.dropbox.com/s/k3a47rq1jniszcd/Screenshot%202014-09-17%2014.59.13.png?dl=0  
  > **username_5**: What's the user:group Apache is running as? http://serverfault.com/questions/125865/finding-out-what-user-apache-is-running-as  
  > **username_0**: Ran this `ps aux | egrep '(apache|httpd)'` and got this -> https://www.dropbox.com/s/2n0h35jsp61t8ob/Screenshot%202014-09-17%2015.06.23.png?dl=0. Doesn't make a lot of sense to me but if you can make anything out that would be great. Really appreciate your help!!  
  > **username_0**: When I run `ps axo user,group,comm | grep apache` I get this https://www.dropbox.com/s/oj7ioyr36plxz6b/Screenshot%202014-09-17%2015.10.08.png?dl=0. So looks like it's running as `root`.. right?  
  > **username_5**: Hrm... looks like it's running as www-data. If you chance the permissions of the craft folder to 777 and it starts working, then that means www-data doesn't have write permissions. You can chmod -R www-data:www-data the craft folder and you should still be able to run with 775.  
  > **username_0**: Yep.. that's it. Got it working running `sudo chown -R www-data:www-data htdocs`. Thanks for your help man!  
  > **username_5**: No problem! Now all you have to do is mark this as the answer. :)  
  
  ---
  
  ### Answer by username_1 on 2017-10-31. Score: 4
  
  If your permissions are set correctly, your php.ini is all correct, your craft folder exists and everything seems like it should work fine... Make sure you have the `app` folder inside the `craft` folder as well.
  
  You'll get the "Could not find your craft/ folder." if there is no app folder.
  
  > **Comments:**
  > **username_2**: This second remark. If you are deploying with git (like I am, on Forge) of course this will happen.  
  
  ---
  
  ### Answer by username_3 on 2017-05-16. Score: 1
  
  Then, set the correct permissions on the document root and Craft files and directories within:
  
  chown -R www-data:www-data /var/www
  
  chmod -R 770 /var/www
  
  chmod -R 775 /var/www/craft
  
  chmod -R 775 /var/www/html
  
  chmod 774 /var/www/craft/app
  
  chmod 774 /var/www/craft/config
  
  chmod 774 /var/www/craft/storage
  
  
  ---
  
  ### Answer by username_4 on 2017-04-14. Score: 1
  
  You can set the proper permissions for the Craft install via:
  
  <https://github.com/nystudio107/craft-scripts>
  
  
  ---
  
  