Home > Bez kategorii > Symfony public_html – changing web directory

Symfony public_html – changing web directory

If you use shared hosting, you probably have public_html directory instead web that symfony projects uses.

if you want to change default folder simply rename web directory to desired name and add following line of code to config/ProjectConfiguration.class.php file

$this->setWebDir($this->getRootDir().'/public_html');

file should look something like that:

/* file config/ProjectConfiguration.class.php */
require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->setWebDir($this->getRootDir().'/public_html');
    $this->enablePlugins('sfDoctrinePlugin');
    $this->enablePlugins('sfFormExtraPlugin');
  }
}

,

Comments:1

Dodaj komentarz
  1. Odpowiedz Enrike
    12/01/24

    Ok, thank you, but I’d like to know WHERE I have to put ALL my project. I mean, in public_html i have to put only the files i found inside /web, or calling the setWebDir method, i just need to put all my app files in public_html? I’m a little confused about it, thank you!

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

*

Możesz użyć następujących tagów oraz atrybutów HTML-a: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks:0

Listed below are links to weblogs that reference
Symfony public_html – changing web directory from Dziennik Programisty
TOP