没有SSH访问的Symfony 2

I have a developed a small web-app in Symfony 2 and Doctrine 2.

Can i deploy it to a web-host that doesn't give SSH access?

I ask this because i see there are a lot of task that must be done from the terminal, like updating the database schema, creating symlinks for the assets, clearing cache, etc...

Should not be a problem:

  • Create a copy of the system somewhere, ideally with identical DB connection params like the production system.
  • Run all the necessary tasks with the --env=prod parameter, if your DB settings allow it.
  • Clone the created production database to the production system (with phpMyAdmin). You can clone the schema from the production database, run app/console doctrine:schema:update --dump-sql locally and then run the generated SQL on the production server.
  • Copy all the files, excluding the dirs in app/cache and app/log

Maybe there is a way (with sftp for example), but it would be like trying to ride a bike with square wheels ;)

I have done this many times with SF 1.4, and it should be just as easy with SF 2.

Some low end hosts have restrictions that will cause issues for symfony, so its important to run the symfony compatibility checker script (you can upload it and then enter its URL in your browser to get the output). Once thats done, follow these simple steps:

  1. copy over all the files for the project. I usually zip/tar the project folder, upload it, and unpack.
  2. Export the database from your development environment and upload it to your new server.
  3. Edit the config and update your database settings. If you have hardcoded paths somewhere in your code, now is the time to fix those as well.
  4. Make sure that the user for apache (or whatever server software your host uses) has full access to the cache and log directories. This can be tricky on some hosts, I have had to contact support in the past to have someone log in and change permissions.
  5. In your web hosts configuration tool, set the webroot for your site to the web folder in your project.