This is another post in our series of guest posts about using PHP Fog. The original post by @developly is reprinted here with permission.

PHP Fog is a new PHP PaaS service. It’s dazzling. It takes the weight of deploying applications to the cloud off your shoulders and allows you to focus on writing code. You can deploy your app’s with a simple git push phpfog master. This is great, but PHP Fog is new and there is no built-in considerations for Symfony2. That makes sense – Symfony2 is still (at the time of writing) in beta. But I want to deploy Symfony2 apps now!
In this article I’ll show you how you can use PHP Fog to host a Symfony2 application. For the purpose of ease we are going to use Github but you could just as easily host your code with Beanstalk, or use PHP Fog’s Git repository alone.
If you already have your application in Git and have at least one production route, then you can skip to the next step.
CompanyExampleBundle where company is the name of your company, group, or project. Don’t forget to add Company to the auto-loader inapp/autoload.php, and register the bundle in app/AppKernel.php.src/Company/Controller/HelloWorldController.php which renders a view CompanyExample:HelloWorld:index.html.twig. In the view, put in a nice little Hello world!.app/routing_dev.yml change the _welcome route’s pattern to /welcome. Now go toapp/routing.yml and add a route like so:http://localhost/yourproject/web/app_dev.php/ in your browser. If you see a Hello world!, then you’re gravy. Now substitute app_dev.php for just app.php to access the production front controller and make sure you see the same thing. If you get a 400 or things appear to be as they were before, you might need to blow production cache. This can be done from the command line like so:Pushing your app to PHP Fog is really easy. It’s perhaps my favorite thing to do.
~/.ssh/id_rsa.pub to the accepted SSH keys in your Account Settings.robots.txt file that comes with Symfony2 by default. Should be at a url like so:http://company.phpfogapp.com/web/robots.txt. If this resolves, you’ve successfully deployed your code to the cloud!You’re not done yet, however, you still need to tweak you PhpFog app to Symfony2’s liking.
You’re almost there. There’s just a couple things left…
app directory, and therefor needs write access. Go to the “Permissions” tab of your app’s admin panel and add the pathname app and save changes.web. This will tidy up your url, you won’t have to type in /web before accessing resources.web/clean_prod_cache.php with the code like so:http://company.phpfogapp.com/clean_prod_cache.php the cache will be wiped and warmed. All ready to go.I hope that this guide helps both developers looking to use Symfony2 on PHP Fog early as well as the PHP Fog team in implementing Symfony2 support.