PHP shared extensions on Linux
- by F21
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.