Updating php app from external server Updating php app from external server curl curl

Updating php app from external server


  1. Use some version control system like Git.
  2. Use some update scripts, scripts checking whether the current version (version on production) is the same as in the remote repository (the most up-to-date one, the one updated when you make changes) and - if the versions differ - update the production.
  3. Invoke the script from point 2. on a constant basis, for example using cron.

This will be the fastest (based on Git internal mechanisms) solution, very reliable (you will be using version control system) and quite secure (you will not be overwriting for example files uploaded by users).

There are some examples of such tools on the Internet.

There is also some example of simply pulling recent changes from the Git repository using cron jobs here: stackoverflow.com/questions/4414140/git-auto-pull-using-cronjob

Alternatively, you can use so called "Service hooks" to call the update scripts only when the version in the repository is changed by someone making the push to the repository (feature is available for example in GitHub).


It depends on your platform. I personally use/support Linux, and use packages (e.g. .deb for Debian-based systems) to bundle, install, and update my apps/services.