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.

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

share|improve this question

migrated from stackoverflow.com Dec 26 '09 at 19:36

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 4 down vote accepted

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:

<?php
  phpinfo();
?>

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.

share|improve this answer
add comment

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.

share|improve this answer
    
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. –  luckytaxi Dec 27 '09 at 16:55
add comment

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.