I'm trying to configure/build PHP 5.3.10 on Linux/Slackware 12 but the extensions appear in the wrong directory when I run make install.

In the php.ini file is the extension dir defined:


Problem is that when I run "make install" the newly built extensions are copied to a subfolder in extensions directory:


What am I supposed to do with this...

  • copy the files down from the no-debug-non-zts-20090626 directory into the extensions directory,

  • create symlinks from extensions to the modules in the no-debug-non-zts-20090626 directory (which will take a lot of time)

  • or what?

(I know I can do any of them, but I want to know the correct way...)


If those are non-zend extensions you should do nothing. If you use (for example):


PHP will find it and load it. Your PHP version already has a default extensions directory as you can see if you run:

php-config --extension-dir

The "20090626" is the PHP API version used, so that you could have different PHP versions running in your server each one using its own extensions. Or if just using one version, so that when you upgrade between API versions (from PHP 5.2 [20060613], or 5.3 [20090626] or 5.4 [20100412], etc.) your old extensions won't break PHP.

But for this to work you need to: - leave the extension where the build script copied it. - load the extension using only its "name.so", not the full path.

You can check the PHP API version by running:

phpize -v

So, when you compile your extensions, you run phpize, which set some variables (including the correct extension directory), so that when the "configure" script creates the Makefile, will set it to "/usr/lib/php/extensions/no-debug-non-zts-20090626" (in this case).

I use Slackware too on several servers, and usually I just leave the extension files wherever the build script installed it.

If you create a test script with a phpinfo() sentence, you can find the value of "extension_dir" configuration option which would be "/usr/lib/php/extensions/no-debug-non-zts-20090626" in your server, unless you had set it to something else in your php.ini file.

Please note this is mostly a linux/unix thing, in Windows you usually have to set explicitly the extension_dir variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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