Common methods for compiling PHP extensions

Source: Internet
Author: User

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

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.