Home > Backend Development > PHP Tutorial > Common methods for compiling PHP extensions, _PHP Tutorial

Common methods for compiling PHP extensions, _PHP Tutorial

WBOY
Release: 2016-07-12 09:03:06
Original
798 people have browsed it

General method for compiling PHP extensions,

Take installing swoole extension 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 (unzip the 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 of the PHP extension library, everyone The path of the phpize command may be different, do not copy and execute directly)

Step 5: ./configure --with-php-config=/usr/local/php/bin/php-config (or use ./configure directly. ./configure is used to configure the upcoming Configure the installed software and check whether the current environment meets the dependencies of the software to be installed)

Step 6: make (compile)

Step 7: make test (This step is to check the make in the previous step to ensure that there are no errors in make)

Step 8: make install

After executing make install, you will see a message 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), the swoole is successfully installed .so is in this directory.

Step 9: vim /usr/local/php/lib/php.ini Add extension=swoole.so

Step 10: service php-fpm reload (or service php-fpm restart, restart PHP’s FastCGI process manager, Now I have nginx, php- The fpm service startup script has been written into /etc/rc.d/init.d)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1084378.htmlTechArticleGeneral method for compiling PHP extensions, taking installing swoole extension as an example: Step 1: wget pecl.php.net/ get/swoole-1.7.21.tgz (download swoole package file) Step 2: tar zxvfswoole-1.7.21.tgz (unzip...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template