The openshift I'm using is a DIY catridge with nginx + php 5.5.8 + phalcon 1.2.4
I have a directory structure as below
website
public
index.php
app
config
config.php
loader.php
routes.php
services.php
the problem is in my public/index.php
i do
try {
/**
* Read the configuration
*/
if (file_exists(__DIR__ . "/../app/config/config.php"))
{
$config = include __DIR__ . "/../app/config/config.php";
}else{
throw new Exception("Failed to include 'config.php'");
}
and it failed
Failed to include 'config.php'
#0 {main}
Is this something to do with openshift? cause I'm doing it correct in my localhost(although it is in apache for localhost) The script should load the config.php
(changed from is_file to file_exist as it make more sense)
openshift does not deny the usage of the config.php file name, make sure you have added it into your git repository and that it is not ignored by any .gitignore files.
Are you sure the file exists? Also, check out if the parent directory has "+x". Quoted from PHP manual (http://php.net/is_file):
Note that is_file() returns false if the parent directory doesn't have +x set for you; this make sense, but other functions such as readdir() don't seem to have this limitation. The end result is that you can loop through a directory's files but is_file() will always fail.
Just found the problem that althought my local repo has above file but not config.php .
Probability 1: Probably because openshift deny the usage of config.php file name
Probability 2: Something bug happened when doing git push
Now dueling with another bug however this bug has been settled