0

I'm working with symfony2 in order to learn this framework.

One thing I've never read anywehere is: how to move your project from develpment env to the prodution env? I mean, what is the "to do list" in order to have my symfony website published correctly (assuming that my prod environment is suitable to the symfony2 requirements)?

4

2 回答 2

3

There's a couple different ways to deploy a symfony2 application. Take a look at this entry in the Symfony Cookbook: How to deploy a Symfony2 application.

After the code is copied to the server basic post-deployment steps may include:

  1. Configure your app/config/parameters.yml file
  2. Update your vendors
  3. Clear your Symfony cache
  4. Dump your Assetic assets
  5. Other things!

There may be lots of other things that you need to do, depending on your setup:

  • Running any database migrations
  • Clearing your APC cache
  • Running assets:install (taken care of already in composer.phar install)
  • Add/edit CRON jobs
  • Pushing assets to a CDN

Personally, I usually use Capifony. I have it copy the application to the server with the third-party libaries. It then performs the post-deployment tasks I need it to do: clearing the cache, dump web assets, and execute database migrations

于 2013-09-26T15:18:45.863 回答
1

There are a few methods to this:

  • On method is to simply copy the files via ftp/scp. Some post-deployment steps have to be done.
  • If you use version control, you can clone the project and execute post-deployment steps.
  • Use deployment tools like capifony.

For deployment basics and post-deployment steps, see the official documentation: How to deploy a Symfony2 application

于 2013-09-26T15:16:40.047 回答