Compile a common PHP extension method ,. Compile the general method of PHP extension, take install swoole extension as an example: Step 1: wgetpecl. php. netgetswoole-1.7.21.tgz (download swoole package file) Step 2: tarzxvfswoole-1.7.21.tgz (decompress compile PHP extension general method,
Take swoole extension installation as an example:
Step 1: wget pecl.php.net/get/swoole-1.7.21.tgz (download the swoole package file)
Step 2: tar zxvf swoole-1.7.21.tgz (extract swoole compressed file)
Step 3: cd swoole-1.7.21 (go to the swoole directory)
Step 4:/usr/local/php/bin/phpize (or directly use phpize.PhpizeThe command is used to prepare the compiling environment of the PHP Extension Library. the path of each person's phpize command may be different. do not copy and execute the command directly)
Step 5:./configure -- with-php-config =/usr/local/php/bin/php-config (or directly use./configure .. /Configure is used to configure the software to be installed and check whether the current environment meets the dependency of the software to be installed)
Step 6: make)
Step 7: make test (this step is to check the previous make and make sure that make is correct)
Step 8: make install
After executing make install, you will see information similar to this:
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/, this path is the path of the PHP extension (extension_dir), swoole installed successfully. so is in this directory.
Step 9: add extension = swoole. so to vim/usr/local/php/lib/php. ini
Step 10: service php-fpm reload (or service php-fpm restart, restart the FastCGI Process Manager of PHP. now I have set nginx, the service startup script of php-fpm has been written into/etc/rc. d/init. d)
Steps 1: wget pecl.php.net/get/swoole-1.7.21.tgz (download swoole package file) Step 2: tar zxvfswoole-1.7.21.tgz (unzip...