PHP shared extensions on Linux

Posted by F21 on Server Fault See other posts from Server Fault or by F21
Published on 2012-12-14T04:41:43Z Indexed on 2012/12/14 5:05 UTC
Read the original article Hit count: 480

Filed under:
|

I am running Ubuntu Server 12.04 and prefer to compile PHP myself as opposed to installing it using apt-get. PHP is running as PHP-FPM.

When compiling extensions, I can set it to be compiled as a shared extension using something like --with-bcmath=shared and so on.

Are there any benefits to compiling the extensions as shared?

I also noticed that the extensions are compiled into a pretty convoluted folder. On my system (my php prefix is /usr/local/php-5.4.9) the extensions end up in /usr/local/php-5.4.9/lib/php/extensions/no-debug-non-zts-20100525.

Is there a global way to set a folder so that all shared extensions will be compiled in there? I understand that I can do something like --with-foobar=shared,/usr/local/foobar/ but having to set the extension folder for each shared extension is inefficient and error-prone.

© Server Fault or respective owner

Related posts about php

Related posts about php-extensions