一篇博文无法写完,见谅!!!
三、
php
扩展模块安装
1
、
libevent
安装
memcache
# rpm -e libevent �Cnodeps
tar xzvf libevent-2.0.13-stable.tar.gz
cd libevent-2.0.13-stable
./configure --prefix=/usr
make && make install
2
、
memcached
安装
memcached
基于
libevent
库进行异步处理
tar xzvf memcached-1.4.7.tar.gz
cd memcached-1.4.7
./configure --with-libevent=/usr
make && make install
tar xzvf memcache-3.0.6.tgz
cd memcache-3.0.6
/usr/local/php5/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config --with-zlib-dir
make
make install
修改
/usr/local/php5/etc/php.ini
;extension_dir = "./"
extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "memcache.so"
memcached
服务启动:
/usr/local/memcached/bin/memcached -d -m 50 -u root -p 12000
memcached介绍见:
http://bensonzy.blog.51cto.com/227860/595642
测试代码:
<?php
$mem = new memcache; \\这里千万不能有双引号
$mem -> connect("172.16.57.10",12000);
$mem -> set('key','this is a test!',0,60);
$val = $mem -> get('key');
echo $val;
?>
验证:
3
、
Zend
安装
tar xzvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.9-linux-glibc23-i386/data
cd 5_2_x_comp/
mkdir -p /usr/local/Zend/lib
cp ZendOptimizer.so /usr/local/Zend/lib/
vi /usr/local/php5/etc/php.ini
在最底部添加:
[Zend]
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so
4
、
eaccelerator
安装
tar xjvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
/usr/local/php5/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php5/bin/php-config
make && make install
vi /usr/local/php5/etc/php.ini
在
zend
上方添加
[eaccelerator]
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/mnt/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.log_file = "/var/log/eaccelerator_log"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
mkdir -p /mnt/eaccelerator
chmod 777 /mnt/eaccelerator/
[root@demo1 bin]# ./php -v \\参见php编译--prefix目录
PHP 5.2.17 (cli) (built: Feb 6 2012 23:53:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
四、开机启动添加:
/etc/rc.local
添加
/usr/local/php5/sbin/php-fpm start
/usr/local/nginx/sbin/nginx
/etc/init.d/mysql start
/etc/profile
添加
ulimit -HSn 65535
如果每次输入长长的路径麻烦,可以添加下编译安装路径到环境变量中或者做软连接,加入/etc/profile中。这里忽略。
五、wordpress安装:
程序软件放置在/home/wwwroot/www.iceman10.com/htdocs \\目录建立文档中略写
# tar xzvf wordpress-3.3.1-zh_CN.tar.gz
创建相应的数据库
# /usr/local/mysql/bin/mysql -uroot -p123456
mysql> create database wordpress;
mysql> grant all privileges on wordpress.* to "wordpressadmin"@"localhost" identified by "123456";
mysql> flush privileges;
# cp wp-config-sample.php wp-config.php
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress 数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL 数据库用户名 */
define('DB_USER', 'wordpressadmin');
/** MySQL 数据库密码 */
define('DB_PASSWORD', '123456');
www.iceman10.com 进行web安装
参考:
lnmp一键安装脚本
blog.s135.com
bbs.linuxtone.org
F&Q
出现下图困扰了我好久,最后是因为测试memcache的php脚本中
$mem = new memcache; 我写成
$mem = “new memcache”; (wrong)
自作聪明,多加了对引号。BS一下自己吧。
(完)