Say I compiled and installed PHP and then I wanted to add an additional extention a few months later.

  1. Do I need to specify everything I've included during my initial installation along w/ the new module I want?

  2. What if I dont recall the exact command I used to compile my initial PHP installation with?

  3. Do I have to go through the whole ...

    ./configure ... make && make install


2 Answers 2


First of all, depending on your distro/environment, the module may be available as an extension DLL/Linux package which is much easier to install, and doesn't require any recompilation. However, if you absolutely have to...

1 - Yes, generally you'll need to specify everything from the initial build. Unless you want to radically change the setup you have (ie remove modules etc)

2 - Create a php file with the following in:


View this script in a browser to see information about your current installation of PHP. At the top you should see the configure command used in the initial build. Note that the paths of some libraries may be different on your machine, if you haven't compiled before (eg paths used during compilation by your favourite distro people).

3 - Yes, generally you'll need to do ./configure [options] && make && make install to get the binaries and modules in the correct places with the configuration options you supplied.


You can compile extensions as shared objects which means you don't need to compile your previous PHP binary from scratch again. However, if for some reason, you don't want to do that, yes, you'll need to remember your previous compile time options. However, that's easily found. A quick script with the following in it, gives you your compile time options

<?php phpinfo(); ?>

My advice is to go the shared extensions route however.

  • What do you mean by shared objects? I wouldn't mind using pre-compiled RPMs but it's a pain in the butt if I wanted to use the latest version of mysql but the PHP binaries I found are for an older version. Due to this, it would be easier for me to compile PHP on my own.
    – sdot257
    Dec 27, 2009 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .