This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » [Tutorial] installing symfony for OVH  (4) 1 Vote(s)
Re: [Tutorial] installing symfony for OVH [message #58188 is a reply to message #10307 ] Thu, 07 August 2008 15:34 Go to previous messageGo to next message
klhoste  is currently offline klhoste
Messages: 10
Registered: August 2008
Location: Aix en Provence
Junior Member
Hello,

I have a problem to export my symfony project on a shared host with OVH (start1g).

I installed symfony with PEAR and i use my own libraries (placed in the /apps/myapp/lib folder ).

I tried different methods but none worked.
First I used the sandbox and didn't find a solution.
Then, by reading the solution given on this website, I moved my project on a "pear-installed-symfony" and follow these steps.

Then i got errors like "classes not found", or "index.php non exists". I copy the .htaccess from this topic and tried to modify it without success...

The symlinks on this server don't seem to work. I created one and when i click on it using a ftp client the server respond "Directory not found"...

And now i don't know what can i do to carry on in a good way...

Does anybody got this kind of problem ? Do you know if it's really possible to export a symfony project to OVH with the "start1g" solution ?


If someone can help me ... Smile

Thank you in advance.
Re: [Tutorial] installing symfony for OVH [message #58189 is a reply to message #10307 ] Thu, 07 August 2008 15:48 Go to previous messageGo to next message
lionel  is currently offline lionel
Messages: 14
Registered: March 2007
Location: Montpellier
Junior Member

Hi,

Does you freeze your project ?


Présentation gratuite de symfony par Fabien Potencier.
Le 09 Octobre à Montpellier.
infos : http://s.ymfony.com
Re: [Tutorial] installing symfony for OVH [message #58198 is a reply to message #58189 ] Thu, 07 August 2008 16:49 Go to previous messageGo to next message
klhoste  is currently offline klhoste
Messages: 10
Registered: August 2008
Location: Aix en Provence
Junior Member
When I run the freeze command, it tells me the /web/sf directory is not empty. So I deleted the content of the directory and then the command didn't work because a file is missing in this directory !!

Is it normal to have this directory not empty when you use PEAR ?

What do exactly the freeze command ? I found any doc about it

Thanks

Kevin
Re: [Tutorial] installing symfony for OVH [message #58688 is a reply to message #58189 ] Thu, 14 August 2008 15:52 Go to previous messageGo to next message
klhoste  is currently offline klhoste
Messages: 10
Registered: August 2008
Location: Aix en Provence
Junior Member
lionel wrote on Thu, 07 August 2008 15:48

Hi,

Does you freeze your project ?


I freezed the project, and upload on OVH. I combined http://trac.symfony-project.org/wiki/InstallingSymfonyOnShar edHostNoSsh and http://trac.symfony-project.org/wiki/InstallingSymfonyOnOVH

Now, I get this structure :
/projects
  /demo
     /apps
     /cache
     /config
     /data
     /doc
     /lib
     /log
     /plugin
/www
  /css
  /img
  /js
  /uploads
  .htaccess
  index.php
  backend.php


In index.php I added :
<?php

/*require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);
sfContext::createInstance($configuration)->dispatch();*/

$vhost_root_dir = realpath(dirname(__FILE__).'/..');
$project_dir = $vhost_root_dir.'/projects/demo';

//define('SF_ROOT_DIR',    realpath(dirname(__FILE__).'/..'));
define('SF_ROOT_DIR',    $project_dir);
define('SF_APP',         'frontend');
define('SF_ENVIRONMENT', 'prod'); // for myapp_dev.php 'prod' should be 'dev'
define('SF_DEBUG',       false);  // for myapp_dev.php this should be true

// include path
set_include_path(
  $vhost_root_dir.'/pear_libs'.PATH_SEPARATOR.
  get_include_path()
);

unset($vhost_root_dir, $project_dir);

require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');

sfContext::getInstance()->getController()->dispatch();

?>


And the .htaccess
SetEnv PHP_VER 5
SetEnv REGISTER_GLOBALS 0
SetEnv MAGIC_QUOTES 0
mod_gzip_on Off
 
Options +FollowSymLinks +ExecCGI
 
<IfModule mod_rewrite.c>
  RewriteEngine On
 
  # we skip all files with .something
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteCond %{REQUEST_URI} !\.php
  #RewriteCond %{REQUEST_URI} !\.php
  RewriteRule .* - [L]
 
  # we check if the .html version is here (caching)
  RewriteRule ^$ /index.html [QSA]
  RewriteRule ^([^.]+)$ /$1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f
 
  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ /index.php [QSA,L]
 
  # hidden frontoffice controller
  RewriteRule ^index\.php/(.*)$ /index.php [QSA,L]
 
  # fo controllers
  RewriteRule ^frontend\.php/(.*)$ /frontend.php [QSA,L]
  RewriteRule ^frontend_dev\.php/(.*)$ /frontend_dev.php [QSA,L]
 
</IfModule>
 
# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"


I created a file config.php in apps/frontend/config :
<?php
$sf_root_dir = sfConfig::get('sf_root_dir');
$sf_upload_dir_name = sfConfig::get('sf_upload_dir_name');
sfConfig::add(array(
  'sf_web_dir_name' => $sf_web_dir_name = 'www',
  'sf_web_dir'      => $sf_root_dir.DIRECTORY_SEPARATOR.$sf_web_dir_name,
  'sf_upload_dir'   => $sf_root_dir.DIRECTORY_SEPARATOR.$sf_web_dir_name.DIRECTORY_SEPARATOR.$sf_upload_dir_name,
));

?>


And now I get this error :
Fatal error: Class 'sfConfig' not found in /home.49/*****/projects/demo/apps/frontend/config/config.php on line 2


I think I have to define where to find the symfony libraries, what is the best solution ?

EDIT:
I forgot to tell you that during the freeze there was a Warning :
Warning: rename(C:\wamp\www\demo\data/symfony/web/sf,C:\wamp\www\demo\web/sf): No such file or directory in C:\wamp\bin\php\php5.2.6\PEAR\
symfony\task\sfFilesystem.class.php on line 189


Thanks

Kévin

[Updated on: Thu, 14 August 2008 16:14]

Re: [Tutorial] installing symfony for OVH [message #59178 is a reply to message #10307 ] Thu, 21 August 2008 10:16 Go to previous messageGo to next message
klhoste  is currently offline klhoste
Messages: 10
Registered: August 2008
Location: Aix en Provence
Junior Member
Finally, I found a solution.

I simply copy all the directories from my symfony application to the root directory on OVH, except the /web directory which is put in the /www directory.
I modified some config files (databases.yml, propel.ini, .htaccess, ProjectConfiguration.class.php).

The .htaccess only contains :
SetEnv PHP_VER 5


The PEAR/symfony libraries are put in /lib/symfony

/config/ProjectConfiguration.class.php is modified :
<?php
require_once '../lib/symfony/autoload/sfCoreAutoload.class.php';


Then do a chmod 705 on directories in / and chmod 755 on directories in /www, and clear symfony cache directory.

Now, I've error 500 when I try to access the backend app, but the frontend works perfectly !

Precision : I didn't freeze the project, is it hazardous ?

Kévin

[Updated on: Thu, 21 August 2008 10:19]

Re: [Tutorial] installing symfony for OVH [message #59189 is a reply to message #10307 ] Thu, 21 August 2008 11:27 Go to previous messageGo to next message
lionel  is currently offline lionel
Messages: 14
Registered: March 2007
Location: Montpellier
Junior Member

Hi Kévin,

It comes from your folder tree and index.php controller.

You comment this 3 lines, which are the setup controller for symfony 1.1 and you rewrite with symfony 1.0 way.
<?php

/*require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);
sfContext::createInstance($configuration)->dispatch();*/
?>


- solution was to keep this 3 lines and change the first one by :
require_once(dirname(__FILE__).'/../projects/demo/config/ProjectConfiguration.class.php');


As I see in your folder tree /project and /www are in the same level.

/projects
  /demo
     /apps
     /cache
     /config
     /data
     /doc
     /lib
     /log
     /plugin
/www
  /css
  /img
  /js
  /uploads
  .htaccess
  index.php
  backend.php


When you freeze a project symfony puts lib and data files in your project folders ( lib/ web/ ) and change your config/ProjectConfiguration.class.php paths.

In this case, you have to create a www folder in your local computer and configure project to work with before freezing.

Add in config/ProjectConfiguration.class.php

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


++



Présentation gratuite de symfony par Fabien Potencier.
Le 09 Octobre à Montpellier.
infos : http://s.ymfony.com
Re: [Tutorial] installing symfony for OVH [message #59193 is a reply to message #10307 ] Thu, 21 August 2008 11:33 Go to previous message
lionel  is currently offline lionel
Messages: 14
Registered: March 2007
Location: Montpellier
Junior Member

Oops wrong button Smile

Conclusion, I advice you to keep default folder tree.

Put in your root host folder all symfony files to have a tree like :

/apps
/cache
/config
/data
/doc
/lib
/log
/plugin
/www
  /css
  /img
  /js
  /uploads
  .htaccess
  index.php
  backend.php


In this way you have nothing to change in your controller index.php.

++
Lionel

Présentation gratuite de symfony par Fabien Potencier.
Le 09 Octobre à Montpellier.
infos : http://s.ymfony.com


Présentation gratuite de symfony par Fabien Potencier.
Le 09 Octobre à Montpellier.
infos : http://s.ymfony.com
Previous Topic:cannot make it work on netfirms, see the error
Next Topic:sf_sandbox installtion error on windows xampp server
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software