PHP shared extensions on Linux

view story

http://serverfault.com – 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 (HowTos)