Ask your Symfony questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Why would inclusion of the config file fail intermittently? Symfony


On a Symfony 1.0 project, does anyone ever get an intermittent errror like this one?

Warning: include(SF_ROOT_DIR/config/config.php): failed to open stream: No such file or directory in /home/public/microsoft/apps/exchange/config/config.php on line 4

Warning: include(): Failed opening 'SF_ROOT_DIR/config/config.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/public/microsoft/apps/exchange/config/config.php on line 4

Warning: require_once(/util/sfCore.class.php): failed to open stream: No such file or directory in /home/public/microsoft/apps/exchange/config/config.php on line 7

Fatal error: require_once(): Failed opening required '/util/sfCore.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/public/microsoft/apps/exchange/config/config.php on line 7

Right now we have several deevelopers working on separate machines, each with a local copy of the software. All of them occasionally get this error. Anyone familiar with this?

Answers (2)


Gordon Franke answers:

i think your web/index.php or web/frontend_dev.php is not correct it must define the SF_ROOT_DIR constant


define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/..'));
define('SF_APP', 'frontend');
define('SF_ENVIRONMENT', 'dev');
define('SF_DEBUG', true);



can you post your config/config.php and your web/index.php


Jakub Zalas answers:

Do you mount directories with your source code? In some cases mounted shares can make the files not readable/accessible.

Anyway it seems you have something uncommon in your config/config.php file. Usually there are only two variables defined (paths to symfony libs):


// symfony directories
$sf_symfony_lib_dir = '/usr/share/php/symfony';
$sf_symfony_data_dir = '/usr/share/php/data/symfony';