Compiling the installation
The swoole extension was built in accordance with the PHP standard Extension. Use Phpize to generate a PHP compilation configuration,./configure to do the compile configuration detection, make to compile, make install Installation.
- Please download the releases version of Swoole and pull the latest code directly from the GitHub trunk may compile but
- If the current user is not root, there may be no write permission for the PHP directory, or the installation requires
sudo
su
- If you are updating your code directly on a git branch
git pull
, be sure to do so before recompilingmake clean
Installation Preparation
Before installing swoole, you must ensure that the following software has been installed
php-5.3.10 或更高版本gcc-4.4 或更高版本makeautoconfpcre (centos系统可以执行命令:yum install pcre-devel)
- Https://github.com/swoole/swoole-src/releases
- Http://pecl.php.net/package/swoole
- Http://git.oschina.net/swoole/swoole
After downloading the source code package, enter the source directory at the terminal, execute the following command to compile and install
CD Swoolephpize./configuremake sudo make install
PECL
Swoole project has been included in the official PHP extension library, in addition to manual download compilation, but also through the official PHP pecl command, one-click Download Installation Swoole
PECL Install Swoole
If there is a version problem with php5.3.3 (cli), http://www.cnblogs.com/cxscode/p/7368131.html
Configure PHP.ini
After compiling and installing successfully, modify php.ini to join
Extension=swoole.so
php -m
phpinfo()
php.ini
You can use php -i |grep php.ini
to navigate to the absolute path by or to see if the Swoole has been successfully loaded, if there is no path that is not possible php.ini
.
You can also locate the location of the swoole.so and paste the swoole.so copy into the php.ini corresponding Extension_dir path
cp/usr/lib64/php/modules/swoole.so/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226
Excerpted from official Documents: https://wiki.swoole.com/wiki/page/6.html
PHP Installation Swoole Extensions