一、系統內容說明
其實只要知道是32位或者64位就行,但是還是帖出來吧,這裡用的是自己的虛擬機器裡的伺服器,公司的就不貼出來了
[root@yuServer ~]# uname -aLinux yuServer.localdomain 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
二、開始安裝1、php-posix
上面是啟動的時候的錯誤,所以這個必須要裝的呦。1)安裝
yum -y install php-process
2)驗證
[root@yuServer ~]# php -m|grep posixposix
2、修改設定檔中的地址把設定檔中的地址改成你現在伺服器的地址,不然就會出現下面的錯誤哦
[root@yuServer workerman]# vi conf/conf.d/GameGateway.conf
[root@yuServer workerman]# vi conf/conf.d/GameWorker.conf
3、安裝memcached1).CentOS memcached安裝前需要先安裝libevent
wget http://www.monkey.org/~provos/libevent-2.0.4-alpha.tar.gztar xzvf libevent-2.0.4-alpha.tar.gzcd libevent-2.0.4-alpha./configure --prefix=/usrmakemake install
2)安裝memcached-1.4.5
wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gztar xzvf memcached-1.4.5.tar.gzcd memcached-1.4.5./configure --with-libevent=/usr/ makemake install
3)啟動memcached
/sbin/ldconfig/usr/local/bin/memcached -d -m 200 -u root -l 127.0.0.1 -p 11211 -c 256 -P /var/memcache.pid
4)查看是否啟動
# ps -ef | grep memcached
5)安裝可能遇到的問題
checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
解決方案
yum install zlib-devel或rpm -ihv zlib-devel-1.2.3-3.x86_64.rpm
4、CentOS環境PHP安裝memcache擴充1)安裝Memcached用戶端庫
yum install libmemcached
2)PHP安裝Memcache擴充
wget -c http://pecl.php.net/get/memcache-3.0.8.tgztar -zxvf memcache-3.0.8.tgzcd memcache-3.0.8phpize./configure - --enable-memcache --with-zlib-dirmake && make installvim /usr/local/php/etc/php.ini extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/memcache.so session.save_handler = memcache session.save_path = "tcp://127.0.0.100:11211"service httpd restart
5、安裝libevent和php擴充1)安裝libevent
yum -y install libevent-devel
2)安裝lib的php擴充
pecl install channel://pecl.php.net/libevent-0.1.0
3)修改php.ini並重啟apache
vim /etc/php.ini #添加一行 extension=libevent.so
5、完成
三、後記在這裡十分感謝 walkor、皺皮豬,希望workerman越來越好!好久沒寫技術部落格了,看來以後要多更新了。