复制代码代码如下: cd ~ wget https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2 tar jxvf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1 /usr/local/lsws/lsphp5/bin/phpize ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/lsws/lsphp5/bin/php-config make make install
复制代码代码如下: /home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function ‘eaccelerator_restore’: /home/package/eaccelerator-0.9.6.1/eaccelerator.c:878: warning: assignment discards qualifiers from pointer target type /home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function ‘eaccelerator_compile_file’: /home/package/eaccelerator-0.9.6.1/eaccelerator.c:1317: error: ‘zend_class_entry’ has no member named ‘line_start’ /home/package/eaccelerator-0.9.6.1/eaccelerator.c: At top level: /home/package/eaccelerator-0.9.6.1/eaccelerator.c:1913: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘eaccelerator_functions’ /home/package/eaccelerator-0.9.6.1/eaccelerator.c:1938: error: ‘eaccelerator_functions’ undeclared here (not in a function) make: *** [eaccelerator.lo] Error
13.配置eAccelerator生效(这一部分在前面的文章里讲过,这里不多说了~)
复制代码代码如下: mkdir /usr/local/eaccelerator_cache chmod -R 777 /usr/local/eaccelerator_cache vi /usr/local/lsws/lsphp5/lib/php.ini
复制代码代码如下: cd ~ wget http://xcache.lighttpd.net/pub/Releases/3.0.0/xcache-3.0.0.tar.gz tar zxvf xcache-3.0.0.tar.gz cd xcache-3.0.0 /usr/local/lsws/lsphp5/bin/phpize ./configure --enable-xcache --with-php-config=/usr/local/lsws/lsphp5/bin/php-config make make install
make install后会给出一个目录,记下来备用,根据litespeed的版本不同,似乎这个目录名也不同~我的是/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/ 2.修改php.ini文件
复制代码代码如下: vi /usr/local/lsws/lsphp5/lib/php.ini
在末尾加入以下内容
复制代码代码如下: extension_dir = "/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525/" extension="xcache.so" [xcache-common] ;; install as zend extension (recommended), normally $extension_dir/xcache.so ;; or install as extension, make sure your extension_dir setting is correct ; extension = xcache.so [xcache.admin] xcache.admin.auth = On xcache.admin.user = "mOo" ; xcache.admin.pass = md5($your_password) xcache.admin.pass = [xcache] xcache.shm_scheme = "mmap" xcache.size = 32M xcache.count = 1 xcache.slots = 8K xcache.ttl = 3600 xcache.gc_interval = 300 ; Same as aboves but for variable cache ; If you dont know for sure that you need this, you probably dont xcache.var_size = 0M xcache.var_count = 1 xcache.var_slots = 8K xcache.var_ttl = 0 xcache.var_maxttl = 0 xcache.var_gc_interval = 300 ; N/A for /dev/zero xcache.readonly_protection = Off xcache.mmap_path = "/dev/zero" xcache.cacher = On xcache.stat = On
其中,密码字段xcache.admin.pass可自定义,用md5加密你要的密码填入,比如
echo -n "vmvps" | md5sum
3.检验php.ini是否出错
/usr/local/lsws/lsphp5/bin/php -v
如果出现如下错误
PHP Fatal error: Directive "allow_call_time_pass_reference" is no longer available in PHP in Unknown on line 0可以通过以下命令解决