PHP MySQL Project Development – Best Approach for Multiple Developers

MySQLPHPteamworkweb-development

We are 4 developers working on a PHP-mySQL web project. Currently we work together as described below:
All project files except DB is hosted at GitHub

  • All project files except DB is hosted at GitHub
  • DB is on our production server
  • We have local web server and php installed and working locally, connection to DB is remote. So database is in sync always.
  • Each developer pulls from GitHub, then pushes his changes to GitHub
  • Server pulls from GitHub to update the website

The problems we've faced so far is

  • Pulling from GitHub on the server is either manual or done by cron job. Which I don't feel it's the right choice.
  • Because our local machines use remote mySQL connection, we encounter time outs in executing queries.

So I don't know what would be a better approach for our situation?

Best Answer

  1. For website updates, you can set up a WebHook (Github -> Repository-Settings -> Webhooks). It can call a custom URL when a push to the repository has happened.

  2. There's something wrong with either your application, your internet connection or MySQL Server. Your setup with a remote database is not uncommon, actually it should be able to maintain a stable connection.

-- Else: like @Evgeny said, you could use a CI Server (Jenkins, TeamCity, etc…) but it really depends on the complexity of your project. Because it's not a "no brainer" to setup such a pipeline with continuous integration.