Compile a common PHP extension method. _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.