0

I need to install two different projects developed with Symfony 1.4. Each project is independent, with its own database and configuration. I need something like the following:

/project1/apps
/project1/config
/project1/lib
.
.
.
/project2/apps
/project2/config
/project2/lib
.
.
.

/htdocs/project1/index.php
/htdocs/project2/index.php

How should I set up index.php and ProjectConfiguration.class.php files, each project? I tried several options but none of them work. The last option I tried was:

index.php:

<?php
require_once('/../project1/config/ProjectConfiguration.class.php');

And ProjectConfiguration.class.php :

<?php

require_once '/../project1/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->enablePlugins('sfDoctrinePlugin');

    $this->setWebDir($this->getRootDir().'/htdocs/project1');
    $this->setCacheDir('/tmp/symfony_cache');
    $this->setLogDir('/tmp/symfony_logs');    

But it does not work:

Warning: require_once(/../project1/config/ProjectConfiguration.class.php): failed to open stream: No such file or directory in /www/mydomain.com/htdocs/project1/index.php on line 2

Fatal error: require_once(): Failed opening required '/../project1/config/ProjectConfiguration.class.php' (include_path='./:/usr/local/php5.4/lib/php') in /www/mydomain.com/htdocs/project1/index.php on line 2

Emii Khaos
  • 9,983
  • 3
  • 34
  • 57
Jorge H
  • 306
  • 1
  • 4
  • 19
  • 1
    You might simply need to use absolute paths instead of relative : http://stackoverflow.com/questions/36577020/ – Vic Seedoubleyew Sep 11 '16 at 08:49
  • @VicSeedoubleyew, Thank you very much. You are right. I solved the problem! – Jorge H Sep 12 '16 at 20:42
  • In index.php, I write: require_once('/www/mydomain.com/project1/config/ProjectConfiguration.class.php'); and again in ProjectConfiguration.class.php: require_once '/www/mydomain.com/project1/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'; – Jorge H Sep 12 '16 at 20:43
  • Glad to know it helped. If that link helped you, feel free to upvote the question and/or the answer, and to mark your question as a duplicate of it – Vic Seedoubleyew Sep 12 '16 at 20:52

0 Answers0