What if PHP is already installed on the server and you need to add additional PHP extensions? No need to reinstall PHP, with Phpize we can install the extension library directly on top of the original PHP base. This compilation is just a separate compilation of PHP extensions, which will then compile the extension libraryadding to the PHP now running, does not recompile the PHP now running, so there is no impact.
Below we demonstrate the installation of XSL extensions (not necessarily common, as an example)procedure One:1. Locate the source code directory for the currently running PHP version, such as php-5.2.3. Enter the XSL extension library directory. $CD/home/pkgs/php-5.3.3/ext/xsl
2. Call the Phpize program to generate the compilation configuration file. $/home/app/php5.3.3/bin/phpize
3. Compile the extension library and perform the following configure and make commands, respectively. $./configure-with-php-config=/home/app/php5.3.3/bin/php-configAfter this step is performed, the Make command is executed, and if configure execution does not pass, then the cause of the error is found. $make#make成功执行后, the resulting extension library file is in the modules subdirectory of the current directory,such as/home/php-5.3.3/ext/curl/modules/xsl.so
4. Configuring the php.ini file#将编译好的扩展库文件复制到PHP的扩展目录下, you can view phpinfo information by: $ cp/home/pkg/php-5.3.3/ext/xsl/modules/xsl.so/home/app/php5.3.3/lib/php/extensions/ no-debug-non-zts-20090626 Locate the Settings extension directory #在php the. ini file, and then set the extension path to the Apache2modules directory and add the extension library location. extension_dir /home/app/php5.3.3/lib/php/extensions/no-debug-non-zts-20090626"extension=xsl.so
5. Restart PHP and view the phpinfo information to see the XSL extension library that you just added. (if there are multiple PHP-FPM processes, smooth restart of the main process can be: KILL-USR2 pid)