Pergunta

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!

Foi útil?

Solução

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.

Outras dicas

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).

how should I go about duplicating the environment? What areas should I check?

You should definitely look into:

  • /etc/httpd/
  • /etc/php5/ (might be a different name)

In particular, start from the files php.ini, httpd.conf and apache2.conf, contained in those folders.

It would be a lot easier and a lot less heartache to simply clone the server, you may need to speak to the guys who look after your servers to do this. The reason why I say this is because there could be various modules/libraries and a whole host of other stuff that is on the server, it would take you a really long time to figure out exactly what you need if you were to get the app to run exactly the same on the CentOS machine. Secondly it's best practice if both environments are identical, this way you know your tests are reliable.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top