There's no standard solution to deploy a php application to a server. Many developers have their own self written scripts or tools. If you're looking for something simple and powerful, try capistrano, it's awesome. It might be not so fast to learn and understand the flow of that tool, but it'll be very very useful once you get it. Even though it was originally written for ruby on rails, it isn't so hard to adjust it for any other framework/language.
Let's consider simple example with yii/php application:
$ gem install capistrano $ clone firstname.lastname@example.org:yiisoft/yii2-app-basic.git $ cd yii2-app-basic/ $ capify .
Now you have a
config/deploy.rb files in your app.
Copy this code sample into your
server settings, load composer and deploy your app:
$ curl -sS https://getcomposer.org/installer | php $ git add . $ git commit -m 'Added composer.phar and capistrano config' $ cap deploy:setup # prepare servers (create basic directory structure etc) $ cap deploy:check # check if everything requred is installed (git for example) $ cap deploy
Now setup your http server to look into correct directory. It would be
And there we are
Here're some useful links:
- Deployment directory structure: wiki.
vendorin our case)
- An explanation of default deployment behaviour: picture and wiki
Still cannot figure out how to set up logger...
Also you can find more information about capistrano tasks with
cap -T or
cap -e deploy:setup.