Development

installing_symfony_on_1and1_sharedhost

You must first sign up to be able to contribute.

Version 4 (modified by patrickinminneapolis, 10 years ago)
--

Installing Symfony on Shared Host 1and1.com Askeet Day 2

Well, its not the easiest thing in the world to be sure, but here's what I learned.

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"

I also put the following in my .htaccess which is probably redundant.

Options +FollowSymLinks? +ExecCGI

<IfModule? mod_rewrite.c>

RewriteEngine? On

AddType? x-mapp-php5 .php
#AddHandler? application/x-httpd-php5 .php #turning this on makes the previous directive fail... why??
#AddHandler? cgi-php5 .php #turning this on makes the previous AddType? directive fail... why??

# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase? /

# we skip all files with .something
RewriteCond? %{REQUEST_URI} \..+$
RewriteCond? %{REQUEST_URI} !\.html$
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.php5 [QSA,L]
RewriteRule?
(.*)$ frontend_dev.php5 [QSA,L]

</IfModule>

# big crash from our front web controller
ErrorDocument? 500 "<h2>Application error</h2>symfony application failed to start properly"

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
file = php.ini
magic_quotes_gpc = 0;

Is this overkill? probably, but I didn't know what the hell I was doing, and everything else was failing.

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.

databases.yml
all:

db214743610:

class: sfPropelDatabase
param:

phptype: mysql
host: db1090.perfora.net
database: db214743610
username: dbo214743610
password: Sx5D22Pu

So this makes Askeet day 2 work. Hope it works for you.

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.

p