Ubuntu / Linux




How to develop and publish PHP websites

How to collaborate on a PHP site and publish easily


Developing a website with others and publish without problems can be quite a challenge. In this tutorial we will look at setting up a collaboration platform with GIT as our Source Code Control System. To setup our own development or test environment we will use JAVA property files containing the production site environment settings as well as our own deviations for our local development environment. When all is done we use ANT in combination with GIT and FTP to create a version we can blindly upload. Although this tutorial is aimed at the Ubuntu/Linux audience, all the tools are available on Windows as well.


Learn how to collaborate on building and deploying websites build with PHP.


PHP Developers


  • Software installation of
    • GIT
    • ANT
    • PHP
    • FTP (like FileZilla)

Required knowledge

  • Knowledge of PHP
  • How to use GIT
    • setup a shared GIT location
    • commit and push changes
  • Publish your site using FTP

Required tools

  • PHP Editor 
  • XML Editor with syntax highlighting
  • command line

Tutorial lessons

This tutorial exists of a number of lessons which must be followed in order to reach the desired effect. Please review each step by clicking on the title

1 - The problem

Before we set out to solving the problem, we should have a clear understandig of what the problem is exactly.
Now we have a clear understanding of the local environment problems and why you should consider using a build script before uploading.

2 - Breaking the problem into parts

We have seen what the two main problems are in collaborating on PHP websites. Now we will break the problem apart and link them to solutions.
Now you have global knowledge of the solution we will work on in the next lessons.

3 - Setup GIT

Although this chapter is in no way a full GIT tutorial we walk through the basic steps to setup a shared GIT repository, and show how to create a local working tree considering the local and production configuration settings file.
First we will setup a bare GIT repository and then clone it to a local repository. Last we will add our JAVA property files to setup the configuration.

4 - Setup local environment

In this lesson we will setup a local environment.
You now have a basic working environment.

5 - Setting up PHP files

In this lesson we will setup the PHP environment to handle our JAVA Property configuration files.
You now have a working development environment. Committing files to the repository is a no-brainer. The production environment configuration is easily maintainable by all developers.

6 - Commit to central repository

Now we have a working example that we should commit to the central repository, before we can add new developers.

7 - Setup ANT

In this lesson we will look at the next part: setting up ANT to create an uploadable site.
Now we have a basic setup for ANT. Next step is to expand with changing properties.

8 - ANT next steps

In this lesson we will finish up on ANT and make our PHP files ready for deployment using FTP.
Now your PHP website is ready for uploading to the production environment.