I am running Amazon Ec2 instance and tried updating the PHP on the site using this guide: http://brianshim.com/webtricks/update-amazon-ami-php5-3-to-php5-4/

And now this is the error I am receiving: Please ensure that $craftPath is set correctly in /var/www/html/staging/public/index.php

I tried resetting the permissions, and restored the old http config files, to no avail. I have no idea what it could be. I checked php.ini for open_basedir and did not find it.

Could it be the permissions?


All Craft is doing is using PHP's is_file() method to check if the supplied path to craft/app/index.php returns true or not.

Take Craft out of the picture and setup a simple PHP script that does


if (is_file('path/to/craft/app/index.php')) {
    echo "found it";
} else {
    echo "oops";

If you get an "oops", then there is some environmental issue (PHP permissions, open_basedir restrictions, Suhosin, mod_security, etc.) that is preventing PHP from finding that file that will need to be addressed.

If it is permissions related (the most common cause), there is a handy script here that will properly set the permissions for a Craft install: https://github.com/nystudio107/craft-scripts/tree/master/scripts

  • Thanks @brad-bell! That's great idea. Quick question: where should I set up this script? Apr 14 '17 at 19:12
  • Putin in your public HTML folder, name it "test.php", then load up yoursite.com/test.php in a browser.
    – Brad Bell
    Apr 14 '17 at 19:13
  • 1
    Great, thanks for the prompt reply. I will try that now :) Apr 14 '17 at 19:14
  • Unfortunately, even if I navigate to /test.php after I placed it in the public folder, it still spits out "Could not find your craft/ folder. Please ensure that $craftPath is set correctly in /var/www/html/production/public/index.php" I tried a var_dump of the $path as a sanity check and it did spit out the right path to the index of the app. I'm guessing it's likely a permission issue right? Apr 14 '17 at 19:26
  • Oh wait, i put it in the wrong directory. I'm getting "found it" it now Apr 14 '17 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.