0

I have recently set up an ExpressionEngine 'Sandbox' test site locally via MAMP (On Mac OSX), and have integrated the Focus Lab LLC’s EE Master Config for when I push the local Sandbox site code to a staging server (using version control via Git/Tower/Beanstalk etc).

I have set up all the configurations as required using the documentation for Focus Lab LLC’s EE Master Config.

The issue:

When I naivgate to the local MAMP Sandbox site URL: ie. http://localhost:8888/sandbox/

I get the following server error message(s):

Warning: require(/Users/karlbowers/Sites/../config/config.master.php): failed to open stream: No such file or directory in /Users/karlbowers/Sites/Sandbox/system/expressionengine/config/config.php on line 410

Fatal error: require(): Failed opening required '/Users/karlbowers/Sites/../config/config.master.php' (include_path='.:/Applications/MAMP/bin/php/php5.5.10/lib/php') in /Users/karlbowers/Sites/Sandbox/system/expressionengine/config/config.php on line 410

I have placed the new 'config' folder at the same level as the 'system' folder.

ie.

public_html

  config
  system
  themes

etc.

I have added the following into my master config file:

if ( ! defined('ENV'))
{
    switch (strtolower($_SERVER['HTTP_HOST'])) {

        case 'sandbox.domainname.co.uk' :
            define('ENV', 'stage');
            define('ENV_FULL', 'Staging');
            define('ENV_DEBUG', FALSE);
        break;

        case 'localhost:8888/sandbox' :
            define('ENV', 'dev');
            define('ENV_FULL', 'Development');
            define('ENV_DEBUG', TRUE);
        break;

        default :
            define('ENV', 'local');
            define('ENV_FULL', 'Local');
            define('ENV_DEBUG', TRUE);
        break;
    }
}

I'm not sure why I am getting the errors stated above? It's like the URL paths are incorrect?

Anyone have any ideas on this?

Many thanks in advance.

Regards

Karl

3

It looks like you're running the system below webroot, which is not how the FocusLab master config is setup to run by default. From the readme:

The instructions above are for setting up the config above webroot (your "public_html, "htdocs", etc directory).

So it assumes this structure:

/config
/httpdocs
/system

If you really need to run your system folder below webroot, see this answer - specifically, you need to change the include paths in /config/config.master.php and /system/expressionegine/config.php.

|improve this answer|||||
  • Hi Derek, (apologies for the long delayed response!). As per your suggestion (and Focuslab Docs) I have tried moving the 'config' & 'system' folder above root as suggested but it still does not seem to work? I tried this on both the local MAMP server and on my staging server set up. Any ideas what could be the problem here? – Karl Bowers Apr 11 '14 at 14:38
0

Your switch/case statement is checking against $_SERVER['HTTP_HOST'] - so for your localhost, this would be localhost, not localhost/folder-name.

Typically, with this kind of setup, "development" and/or "staging" would be referring to a remote server - your localhost should instead fall under the final default case for local environments. This allows you to use either "localhost" or a named vhost (eg, "http://project.dev").

|improve this answer|||||

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.