To install the swoole extension, for example:
Step 1:wget pecl.php.net/get/swoole-1.7.21.tgz (download swoole package file)
Step 2:tar zxvf swoole-1.7.21.tgz (unzip swoole compressed file)
Step 3:CD swoole-1.7.21 (Enter the Swoole directory)
Step 4:/usr/local/php/bin/phpize ( or use phpize directly ). The phpize command is used to prepare the compilation environment for the PHP Extension library, and the path of each person's phpize command may be different, not directly copied execution)
Step 5:./configure--with-php-config=/usr/local/php/bin/php-config ( or directly using the./configure ./configure The role is to configure the software that will be installed to check whether the current environment meets the dependencies to install the software)
Step 6:make (Compile)
Step 7:make Test (This step is the check of the previous make, making sure there is no error)
Step 8:make Install
After performing the make install, you will see information like this:
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/, this path is the PHP extension (extension_ DIR), the successful installation of the swoole.so is in the directory.
Step 9: Vim/usr/local/php/lib/php.ini Adding extension=swoole.so
Step 10:service php-fpm Reload (or service php-fpm restart, restart PHP fastcgi process Manager, now I have put Nginx, PHP-FPM service startup script has been written into/etc/rc.d/init.d)
Common methods for compiling PHP extensions