What are the advantages and disadvantages of compiling PHP versus using pre-built packages for server updates?

When updating a server with PHP, you can either compile the PHP source code yourself or use pre-built packages provided by the distribution. Compiling PHP allows for more customization and control over the installation process, but it can be more time-consuming and complex. Using pre-built packages is quicker and easier, but you may have less flexibility in terms of configuration options.

// Example PHP code snippet for compiling PHP from source code

./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --enable-mbstring --enable-mysqlnd --with-curl --with-openssl

make

make install