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

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:

/usr/lib/php/extensions

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

/usr/lib/php/extensions/no-debug-non-zts-20090626

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...)

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

extension="suhosin.so"

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.

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.