After wasting time on a failed attempt to host a Symfony2 based website on GoDaddy since they don’t allow you to change the document root for the primary domain, we looked for other shared hosters where we could deploy small projects which don’t need a VPS or root server. We tried Host Europe since we are very satisfied with the VPSs and root servers we have there.
And after a little bit of trial & error it works fine! Here are the steps you need to deploy your Symfony2 based webapp on a Host Europe WebPack L:
1. Create a FTP user
Create a FTP login which corresponds to the user the webserver runs as (i.e. the user, not the login, starts with “wp-“). You could also choose a separate FTP user, which is more secure, but more complicated as well. Be sure to make
app/cache writeable in that case.
2. Configure Suhosin
In your WebPacks config go to “Skripte”-> “Skript-Einstellungen” -> “PHP Suhosin Executor Include Whitelist” and activate “phar”.
3. Adapt document root
Now go to “Domains” -> “Domainzuordnungen editieren” and change the document root of the relevant domains to
4. Hard copy assets
We always make Assetic symlink our assets, but you have to switch to hard copying them for the FTP upload to Host Europe. So set “symfony-assets-install” to “copy” in
composer.json or remove the entry, since it’s the default value.
5. Install vendors and generate assets
Initialize the application by downloading the vendors:
composer.phar install --optimize-autoloader
And generate & copy the assets:
php app/console assetic:dump --env=prod --no-debug
6. Upload website
Now everything is read to be uploaded to
/www via FTP. Empty the
app/cache directories before you upload.
Your Symfony2 should now run smoothly on a cheap Host Europe WebPack. Actually it’s pretty fast in our opinion and sufficient for most smaller use cases!
As of September 2013 Host Europe only supports PHP 5.3 unfortunately, so watch out for anything which might not be supported (e.g. the new array syntax
). Also call
app_dev.php while temporarily disabling the localhost security check to debug any errors. If it takes a while to load everything should work, this will probably just be the assetic compile processes in dev mode timing out, since you are not allowed to run them.