Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The production server is shared, I don't have access to php.ini and httpd.conf and most PHP settings cannot be set or overrided using ini_set PHP function.

So I would like to create a local development environment having configurations as close as it can be to those of the production environment (LAMP). I don't have shell access to the server but using exec PHP function to run some simple commands is possible.

I am using Windows XP Pro and I am going to install on VMWare a linux distribution that is more or less the same as the production server. However, installing apache, mysql and php, and then configuring them like those on the production server is not a easy task.

It would be great if there exists any tools that are useful in this situation, tools that can analyze/ inspect the production server and then produce something that can help replicating the environment would be useful.

If not, what should I be aware of when I try to manually replicate the production environment?

share|improve this question
    
Are you trying to override settings, or just see what they are? If you're trying to override and don't have php.ini access, there are some ways to get around that if you can set Apache handlers and whatnot. Or, are you just trying to mimic the shared environment for development purposes? –  McJeff Apr 6 '10 at 0:30
    
@McJeff I am trying to mimic the shared environment for development purposes. –  bobo Apr 6 '10 at 0:42
1  
php_info() should give you much of the information you need –  svrist Apr 6 '10 at 8:33

2 Answers 2

up vote 1 down vote accepted

There is no such function "php_info()", it should be "phpinfo()".

You've several options:

  • Use the package manager of your Linux OS for installing software (apt-get for Debian/Ubuntu, yum for Redhat (RHel), ...)
  • Compile your own software (using the PHP configure line and/ or apache modules from phpinfo() if available)
  • Get a LAMPP package like "XAMPP for Linux"

The second option is recommended for advanced users only, or if you have spare time to learn (and break) things (like me :p)

Your package manager is better customizable than XAMPP. If you need a component (say PHP GD), you'ld just apt-get/yum/whatever it.

Here's a guide on How to forge for installing a LAMPP server on CentOS using packages: http://www.howtoforge.com/perfect-server-centos-5.2

share|improve this answer

So as Svrist said, you can pull the vast majority of the PHP configuration information out of php_info(). Just put up a .php page and simply enter <? php_info(); ?>. It ought to print out your configuration.

It might help you to also pull a list of the installed software, too. If it's a Red Hat derivative, stick a 'rpm -qa' as a PHP shell pass-through and you'll get a good idea of what's installed. If it's a Ubuntu/Debian machine, then dpkg --list.

Finally, you can use a combination of command line options to the httpd daemon to pull information out. Are you certain the configuration isn't readable? That's possible, but usually not by default.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.