Installing Symfony on a 1&1 shared host
Symfony needs php5, and 1and1 defaults to php4.
Add the following lines to your .htaccess:
AddType x-mapp-php5 .php AddHandler x-mapp-php5 .php
So:
Options +FollowSymLinks +ExecCGI[[BR]]
<IfModule mod_rewrite.c>[[BR]]
RewriteEngine On[[BR]]
AddType x-mapp-php5 .php[[BR]]
AddHandler x-mapp-php5 .php[[BR]]
# uncomment the following line, if you are having trouble[[BR]]
# getting no_script_name to work[[BR]]
RewriteBase /[[BR]]
# we skip all files with .something[[BR]]
RewriteCond %{REQUEST_URI} \..+$[[BR]]
RewriteCond %{REQUEST_URI} !\.html$[[BR]]
RewriteRule .* - [L]
[[BR]]
# we check if the .html version is here (caching)[[BR]]
RewriteRule ^$ index.html [QSA][[BR]]
RewriteRule ^([^.]+)$ $1.html [QSA][[BR]]
RewriteCond %{REQUEST_FILENAME} !-f[[BR]]
# no, so we redirect to our front web controller[[BR]]
RewriteRule ^(.*)$ index.php [QSA,L][[BR]]
</IfModule>[[BR]]
# big crash from our front web controller[[BR]]
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"[[BR]]
You 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
File: web/php.ini
magic_quotes_gpc = off magic_quotes_runtime = off magic_quotes_sybase = off
On 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.
databases.yml
all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
host: db1090.perfora.net
database: dbxxxxx
username: dbxxxx0
password: xxxxxxx
You should also update the propel.ini with the new DSN.
Note that all symfony commands need to be prefixed with php5 as that is the name of the PHP 5 binary on the server.
If you are installing symfony into a subdirectory on the host, refer to InstallingSymfonyInASubDirectory