Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to duplicate a PHP-based website? [closed]

Background:

I'm new to PHP, but I've been asked to make some code changes to support an application hosted on our Intranet. The actual code changes don't look too bad. However, there is currently no development environment, so I have undertaken to create a duplicate server to develop and test my changes.

At this point, and not being well-versed in PHP, it looks like I may have to reverse engineer all the Apache HTTPD and PHP configuration settings/options/packages on the production machine unless I can strategically copy the existing production environment to the development machine.

My questions:

  1. Is it possible to do that? i.e. to FTP certain directories in the Apache/PHP installation over to replicate the original environment? If so, which directories? One complication may be that the original environment is SUSE Linux and the development machine is CentOS. Other than that, I have installed the matching HTTPD and PHP versions on the dev machine.
  2. If this isn't wise/possible, how should I go about duplicating the environment? What areas should I check?

Thanks in advance!

like image 282
Steve T Avatar asked Nov 06 '12 21:11

Steve T


2 Answers

An alternative to the already mentioned solutions would be to setup a virtual host on the production machine, something like test.yourdomain.com and copy the database to a test database.

Then you could test your site on the live server in a test environment and you would only have to change your db connection settings in the test version.

like image 85
jeroen Avatar answered Oct 16 '22 08:10

jeroen


Clone the entire thing into a VM, extract the code and put it into a source code repository (for example git).

After that develop on your machine, deploy to your VM (unless you can get another machine or you have time and patience to reverse engineer the configuration of your cloned machine).

You can start deploying by simply pulling the code from your VM, but if you think that your project might last longer consider setting up a Continous Integration environment and also putting your VM config files into a git repository co you can recreate it in production (or hook your production into CI).

like image 27
Chris Hasiński Avatar answered Oct 16 '22 06:10

Chris Hasiński