Development

installing_symfony_on_1and1_sharedhost (diff)

You must first sign up to be able to contribute.

Changes between Version 4 and Version 5 of installing_symfony_on_1and1_sharedhost

Show
Ignore:
Author:
jamiel (IP: 86.132.155.178)
Timestamp:
09/23/08 00:59:59 (9 years ago)
Comment:

Up to date version

Legend:

Unmodified
Added
Removed
Modified
  • installing_symfony_on_1and1_sharedhost

    v4 v5  
    1 Installing Symfony on Shared Host 1and1.com Askeet Day 2 
     1== Installing Symfony on a 1&1 shared host == 
     2  
     3Symfony needs php5, and 1and1 defaults to php4.   
    24 
    3 Well, its not the easiest thing in the world to be sure, but here's what I learned.  
     5Add the following lines to your .htaccess: 
    46 
    5 Symfony needs php5, and 1and1 defaults to php4, so you want to change myApplication/web/index.php => index.php5, and frontend_dev.php -> frontend_dev.php5.  Also all symfony commands must be prefaced with php5, ie. "php5 symfony cc frontend" 
     7{{{ 
     8AddType x-mapp-php5 .php 
     9AddHandler x-mapp-php5 .php 
     10}}}  
    611 
    7 I also put the following in my .htaccess which is probably redundant.  
     12So: 
    813 
     14{{{ 
    915Options +FollowSymLinks +ExecCGI[[BR]] 
    1016 
    1218  RewriteEngine On[[BR]] 
    1319 
    14   AddType x-mapp-php5 .php [[BR]] 
    15   #AddHandler application/x-httpd-php5 .php  #turning this on makes the previous directive fail... why??[[BR]] 
    16   #AddHandler cgi-php5 .php  #turning this on makes the previous AddType directive fail... why??[[BR]] 
     20  AddType x-mapp-php5 .php[[BR]] 
     21  AddHandler x-mapp-php5 .php[[BR]] 
    1722 
    1823  # uncomment the following line, if you are having trouble[[BR]] 
    3136 
    3237  # no, so we redirect to our front web controller[[BR]] 
    33   #RewriteRule ^(.*)$ index.php5 [QSA,L][[BR]] 
    34   RewriteRule ^(.*)$ frontend_dev.php5 [QSA,L] [[BR]] 
     38  RewriteRule ^(.*)$ index.php [QSA,L][[BR]] 
    3539</IfModule>[[BR]] 
    3640 
    3741# big crash from our front web controller[[BR]] 
    3842ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"[[BR]] 
     43}}} 
    3944 
     45You do not have access to the php.ini on Linux sharedhosting, however you can create a php.ini file in your web root with overrides 
    4046 
     47File: web/php.ini 
    4148 
     49{{{ 
     50magic_quotes_gpc = off 
     51magic_quotes_runtime = off 
     52magic_quotes_sybase = off 
     53}}} 
    4254 
    43 ok, next thing I noticed is that I don't have control of php.ini, and you need to turn off magic quotes apparently. So I put the following php.ini file in EVERY directory with .php [[BR]] 
    44 file = php.ini[[BR]] 
    45 magic_quotes_gpc = 0;[[BR]] 
    46  
    47  
    48 Is this overkill? probably, but I didn't know what the hell I was doing, and everything else was failing.[[BR]] 
    49  
    50 The final thing is the yaml file, since you can't control DB names on 1and1 I had to do the following... NOTICE the second line is NOT 'propel' its the goofy db name that 1and1 uses --> this will probably break things, maybe lots of things, but its how I got askeet day 2 to work. Incidentally, use index.php instead of frontend_dev.php if you have the DB working, because frontend_dev failed for some reason.   
     55On shared hosting a database will be created for you on a seperate host when you use your Control Panel. Be sure to change this hose in your databases.yml.   
    5156 
    5257databases.yml[[BR]] 
    5358all:[[BR]] 
    54   db214743610:[[BR]] 
    55  
     59  propel:[[BR]] 
    5660    class:      sfPropelDatabase[[BR]] 
    5761    param:[[BR]] 
    5862      phptype: mysql [[BR]] 
    5963      host: db1090.perfora.net[[BR]] 
    60       database: db214743610[[BR]] 
    61       username: dbo214743610[[BR]] 
    62       password: Sx5D22Pu [[BR]] 
     64      database: dbxxxxx[[BR]] 
     65      username: dbxxxx0[[BR]] 
     66      password: xxxxxxx [[BR]] 
    6367 
     68You should also update the propel.ini with the new DSN. 
    6469 
    65 So this makes Askeet day 2 work. Hope it works for you.  
     70Note that all symfony commands need to be prefixed with php5 as that is the name of the PHP 5 binary on the server. 
    6671 
    67  
    68 WAIT. I forgot one thing, I opened up Propel.php and manually set the $dsn = 'mysql://dbo214743610:Sx5DwfPu@db1090.perfora.net/db214743610'; in the getConnection() function. 
    69  
    70  
    71 p  
    72  
    73  
    74  
    75  
    76  
     72If you are installing symfony into a subdirectory on the host, refer to InstallingSymfonyInASubDirectory