Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am compiling php, and its setting my modules directory to /usr/lib64/20090626-zts

I would like to change this to /usr/lib64/php/modules, but I cannot find a configuration option to do so.

I can change it in my php.ini and move the directory, but when I run phpize and make a new module it still puts it in /usr/lib64/20090626-zts

share|improve this question
Haven't have time to test this: EXTENSION_DIR=/usr/lib64/php/modules phpize. – Mark Wagner Sep 27 '11 at 23:54
up vote 4 down vote accepted

I would suggest making /usr/lib64/php/modules a symlink to the folder with the ID. This prevents mixing extensions from different versions of PHP in the long run.

Besides that: You should be able to set it by setting EXTENSION_DIR as environment variable before running PHP's configure. something like

 $ EXTENSION_DIR=/my/location ./configure --with-some-extension
share|improve this answer
Yeah that makes sense, I don't want my modules to conflict in the future. I think I will just leave the folder name alone. – copacetic Sep 28 '11 at 16:09

Check the current extension directory with:

php-config --extension-dir

and you can change it by setting extension_dir in php.ini:


Don't forget to restart Apache.

share|improve this answer

Your Answer


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.