---
title: "centOS下 PHP + swoole 安装记录"
author: "xxi"
date: "2014-10-17T17:27:30Z"
tags: []
categories: ["编程语言"]
slug: "centos-php-swoole"
draft: false
lastmod: "2014-10-17T17:27:30Z"
id: 2144792
url: "https://xxi.iteye.com/blog/2144792"
---

swoole 有点类似node.js  ,  swoole纯C编写的PHP扩展. 多进程和非阻塞


安装php :
先卸载:
# yum remove php  php-bcmath php-cli php-common  php-devel php-fpm    php-gd php-imap  php-ldap php-mbstring php-mcrypt php-mysql   php-odbc   php-pdo   php-pear  php-pecl-igbinary  php-xml php-xmlrpc

源
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

安装php5.5
yum install php55w  php55w-bcmath php55w-cli php55w-common  php55w-devel php55w-fpm    php55w-gd php55w-imap  php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql   php55w-odbc   php55w-pdo   php55w-pear  php55w-pecl-igbinary  php55w-xml php55w-xmlrpc php55w-opcache php55w-intl php55w-pecl-memcache

php5.5 默认带有pdo,不需要先安装 mysql

php.ini修改
date.timezone = 'Asia/Shanghai'

注意卸载:
yum remove httpd

安装swoole:
https://github.com/swoole/swoole-src/releases

# wget https://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz
tar zxvf swoole-1.7.6-stable.tar.gz
swoole-1.7.6-stable.tar.gz
phpize
./configure
make
make install

下面扩展加入到php.ini
extension=swoole.so