Install XCache PHP Accelerator in Linux by Compiling from Source安装xcache的PHP加速器,在Linux的编制从源

XCache is an alternative yet fast and stable PHP accelerator and opcode cacher that is similar to the famous eAccelerator and APC (Alternative PHP Cache). xcache是另一种然而,快速而稳定的PHP加速器和操作码cacher是类似著名的eaccelerator和APC (可选PHP缓存) 。 XCache extension works by caching the compiled bytecode (opcode or intermediate code) form of PHP scripts to avoid the overhead to parse and compile PHP source code on every page request, and thus reduces server loads, boosts the performance of PHP scripts and increases the speed of PHP code from 2-10 times. xcache扩建工程通过高速缓存编译字节(操作码或中间代码)形式的PHP脚本,以避免额外开销解析和编译PHP的源代码在每个网页上的要求,从而减少了服务器的负荷,增强的表现, PHP脚本和增加的速度对PHP代码从2-10倍。

XCache supports all of the latest PHP cvs branches such as PHP 4.3, PHP 4.4, PHP 5.1 and PHP 5.2 on Linux server including CentOS which common used on cPanel and Plesk based web hosting server, and ThreadSafe/Windows web server. xcache支持所有最新的PHP的CVS的分支,如PHP的4.3 , PHP的4.4 , PHP的5.1和PHP 5.2的Linux服务器上,包括centos共同使用的的cPanel和plesk基于网络托管服务器,多线程/在Windows Web服务器。 XCache overcomes a lot of problems that exist on opcachers or accelerators such as unable to work with new PHP versions. xcache克服了很多存在的问题,就opcachers或加速器,如无法工作与新的PHP版本。 Beside, XCache also been旁边,也被xcache benchmarked to be faster基准,以更快 than other opcode cachers.比其他操作码cachers 。

This is a simple tutorial and guide on how to install XCache PHP cacher by manually compiling from source code package.这是一个简单的补习和指导如何安装xcache的PHP cacher通过手动编制从源代码包。 If you’re using Wordpress or using XCache to speed up and improve Wordpress blog performance, you should first ensure that PHP is upgraded to latest version (PHP 5.2.1), as PHP 4 may cause some instability issue such as unable to post comment, partial page loading and etc. Anyway, PHP5 is always recommended if possible.如果您使用的WordPress或使用xcache加快和完善WordPress所博客的表现,您应该先确保PHP是升级到最新版本( PHP在5.2.1 ) , PHP 4中可能会造成一些不稳定的问题,如无法张贴评论,局部页面加载等,无论如何, php5始终是建议,如果可能的。 And as with all PHP accelerator, XCache won’t work with PHP suEXEC turns on.作为与所有PHP加速器, xcache将不会工作,用PHP suexec轮流上。 PHP suEXEC must be disabled for XCache to work properly. PHP的suexec必须停用xcache才能正常工作。

Currently, XCache maintains 2 branches, ie version 1.0.3 and version 1.2.0.目前, xcache保持二科,即1.0.3版和1.2.0版。 Both version is now stable release, with version 1.0.x recommended for PHP 4.3.x and 4.4.x, and version 1.2.x recommended for most version of PHP including 5.1.x and 5.2.x, except PHP 5.0.x series.这两个版本,现在是稳定的释放,与1.0.x版本建议,对于PHP 4.3.x和4.4.x版本,版本1.2.x建议大多数的PHP版本中包括5.1.x和5.2.x ,除了PHP的5.0.x系列。 If you’re using PHP4, try both version of XCache to pick the one most suitable for your application.如果您使用php4 ,请尝试都版本的xcache挑选一个最适合您的申请。 To check which version of PHP you’re usinng, issue command php -v or setup a PHP file with the following content, then call the file from web browser:检查哪一个版本的PHP您usinng ,问题命令的PHP - V或设置一个PHP文件与以下内容,然后调用文件从Web浏览器:

<?php < ? PHP的
phpinfo(); phpinfo ( ) ;
?> ? >

  1. Change to user local source directory such as /usr/local/src by using following command:改变用户本地源目录中,如/ usr / local /下钢骨混凝土用以下命令:

    cd /usr/local/src裁谈会在/ usr / local /钢骨混凝土

  2. Retrieve and download the source package of the version of XCache you choose to install.检索和下载源码包的版本xcache您选择安装。

    wget http://210.51.190.228/pub/XCache/Releases/xcache-1.0.3.tar.gz (for XCache 1.0.3) wget http://210.51.190.228/pub/xcache/releases/xcache-1.0.3.tar.gz ( xcache 1.0.3 )

    or

    wget http://210.51.190.228/pub/XCache/Releases/xcache-1.2.0.tar.gz (for XCache 1.2.0) wget http://210.51.190.228/pub/xcache/releases/xcache-1.2.0.tar.gz ( xcache 1.2.0 )

  3. Untar, unzip, unpack or extract the archive with one of the following commands: untar ,解压缩,解压或提取物馆与下列命令之一:

    tar -zxf xcache-*.tar.gz焦油zxf xcache - *. tar.gz
    gzip -dc xcache-*.tar.gz | tar -x gzip -直流xcache - *. tar.gz |焦油- X的

  4. Go into the xcache directory with source content:进入xcache目录与源内容:

    cd xcache裁谈会xcache

  5. Trigger PHP building environment:触发PHP的建筑环境:

    phpize

  6. Optional but recommended practice is to build XCache outside of source directory:可选,但建议的做法,是要建立xcache以外的源目录:

    mkdir ../xcache-build mkdir .. / xcache -建设
    cd ../xcache-build裁谈会.. / xcache -建设

  7. Run the configure with the option that you want, the basic is as below which will enable the XCache by default:运行配置与您想要的选项,基本是下面这将使xcache默认情况下:

    ../xcache/configure –enable-xcache .. / xcache /配置启用- xcache

    You can list out all available options by using ../xcache/configure –help command, which will display the following:您可以列出所有可供选择使用.. / xcache /配置帮助命令,该命令将显示以下内容:

    –enable-xcache Include XCACHE support. -让- xcache包括xcache支持。
    –enable-xcache-optimizer XCACHE: (N/A) -让- xcache -优化xcache : ( /一)
    –enable-xcache-coverager XCACHE: Enable code coverage dumper -让- xcache - coverager xcache :使代码覆盖泥头
    –enable-xcache-assembler XCACHE: (N/A) -让- xcache -汇编xcache : ( /一)
    –enable-xcache-disassembler XCACHE: Enable opcode to php variable dumper -让- xcache - disassembler xcache :使操作码,以PHP变量翻车
    –enable-xcache-encoder XCACHE: (N/A) -让- xcache编码xcache : ( /一)
    –enable-xcache-decoder XCACHE: (N/A) -让- xcache编解码器xcache : ( /一)
    –enable-xcache-test XCACHE: Enable self test - FOR DEVELOPERS ONLY!! -让- xcache试验xcache :启用自检-开发商只!

  8. Compile the source with following command:编译源与以下命令:

    make制造

    Ensure that no error occurred.确保不发生错误。

  9. If you haven’t already using root account, su to root user.如果您尚未使用root帐号,苏,以root用户。
  10. Install XCache binary with the following command:安装xcache二进制与以下命令:

    make install使安装

    Ensure that no error occurred, and note down the extension installation path of the xcache.so.确保不发生错误,并记下延长安装路径的xcache.so 。

  11. Next, XCache need to be configured and enabled in PHP.INI file.接下来, xcache必须配置并启用在php.ini文件。 Locate the correct location of php.ini configuration file by using找到正确的位置php.ini配置文件中使用 phpinfo() phpinfo ( ) function (see sample listed above to check version of PHP).功能(见样本,上面列出的检查版的PHP ) 。 In web hosting environment, normally it’s located in /etc or /usr/local/lib.在Web托管环境,通常它位于在/ etc或/ usr / local / lib目录中。 If the install of PHP parses the /etc/php.d/ folder, then simply create a file in that folder named “xcache.ini” or copy over the sample xcache.ini came with source package.如果安装的PHP解析的/ etc / php.d /文件夹,然后简单地创建一个文件在该文件夹命名为“ xcache.ini ”或复制的样本xcache.ini来与源码包。

    Change back to xcache source unpack directory, and run the following command with root user:改变回xcache来源解压目录,并运行以下命令与root用户:

    cat xcache.ini >> /etc/php.ini猫xcache.ini > >的/ etc / php.ini中
    $EDITOR /etc/php.ini元编辑器的/ etc / php.ini中

    Note: change to the path of php.ini accordingly注意:改变路径在php.ini因此

    This will append the default XCache configuration to the end of php.ini.这将附加的默认xcache配置到去年底, php.ini的影响。 Alternatively, you can copy and paste the following text into the php.ini file yourself too:另外,您也可以复制并粘贴以下文本到php.ini文件自己太:


    [xcache-common] [ xcache -共同]
    ;; install as zend extension (recommended) ; ;安装Zend扩展(推荐)
    zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-xxx/xcache.so zend_extension = / usr / local /下的lib / PHP中/扩展/无-调试-非特稿-三十/ xcache.so
    ;; install as zend extension with thread-safe ; ;安装Zend扩展与线程安全
    ; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so ; zend_extension_ts = / usr / local /下的lib / PHP中/扩展/非调试-特稿-三十/ xcache.so
    ;; install as PHP extension (extension_dir must be set to the full path to xcache.so) ; ;安装作为PHP扩展( extension_dir必须设置的完整路径xcache.so )
    ; extension = xcache.so ;扩展= xcache.so

    [xcache.admin] [ xcache.admin ]
    xcache.admin.user = “admin” xcache.admin.user = “管理员”
    xcache.admin.pass = md5($your_password) xcache.admin.pass =的MD5 ( $ your_password )

    [xcache] [ xcache ]
    xcache.shm_scheme = “mmap” xcache.shm_scheme = “ mmap ”
    xcache.size = 16M xcache.size =一六米
    xcache.count = 1 xcache.count = 1
    xcache.slots = 8K xcache.slots = 8K型
    xcache.ttl = 0 xcache.ttl = 0
    xcache.gc_interval = 0 xcache.gc_interval = 0

    xcache.var_size = 0M xcache.var_size = 0米
    xcache.var_count = 1 xcache.var_count = 1
    xcache.var_slots = 8K xcache.var_slots = 8K型
    xcache.var_ttl = 0 xcache.var_ttl = 0
    xcache.var_maxttl = 0 xcache.var_maxttl = 0
    xcache.var_gc_interval = 300 xcache.var_gc_interval = 300

    xcache.test = Off xcache.test =小康
    xcache.readonly_protection = Off xcache.readonly_protection =小康
    xcache.mmap_path = “/dev/zero” xcache.mmap_path = “ /开发/零”
    xcache.coredump_directory = “” xcache.coredump_directory = “ ”
    xcache.cacher = On xcache.cacher =对
    xcache.stat = On xcache.stat =对
    xcache.optimizer = Off xcache.optimizer =小康

    [xcache.coverager] [ xcache.coverager ]
    xcache.coverager = Off xcache.coverager =小康
    xcache.coveragedump_directory = “” xcache.coveragedump_directory = “ ”

  12. You can configure XCache to your preference.您可以设定xcache您的喜好。 One setting that must be changed is under the [xcache-common], where you must specify the correct installation path of the XCache extension module. 1设置必须改变,是根据[ xcache -共同] ,在这里您必须指定正确的安装路径的xcache扩展模块。 You can also opt to run XCache as PHP extension instead of extension for Zend module.您也可以选择运行xcache作为PHP的扩展,而是扩展的Zend模块。 In this case, comment and uncomment the line accordingly.在这种情况下,评论和注释线。 Other important options include “xcache.size” which specify amount the memory allocated to XCache, “xcache.count” to take advantage of multi-core processors or multiple processors.其他重要的选项包括“ xcache.size ”指定金额的内存分配给xcache , “ xcache.count ” ,以利用多核心处理器或多个处理器。 And if you plan to use XCache web administration interface, input the “xcache.admin.user” and md5 checksum value of “xcache.admin.pass”.如果您打算使用xcache Web管理介面,输入“ xcache.admin.user ”和MD5校验和价值“ xcache.admin.pass ” 。 Try尝试 MD5 tools MD5的工具 to generate the correct value, or use the following command to generate the MD5 for your password:以产生正确的值,或使用下列命令产生的MD5为您的密码:

    echo -n “password” | md5sum回声- N的“密码” | md5sum

    Note: Explanation and definition of all XCache INI settings can be found注:解释和定义,所有xcache的INI设置可以找到 here这里 .

  13. Restart the Apache httpd web server.重新启动的Apache的httpd网页伺服器。 The following commands should work:下面的命令应该工作:

    /etc/init.d/apache* restart / etc / init.d /的阿帕奇*重新启动

    or

    /etc/init.d/httpd* restart / etc / init.d /的的httpd *重新启动

  14. Ensure the XCache is running by calling PHP file with phpinfo() (see sample above).确保xcache运行致电PHP文件与phpinfo ( ) (见上述范例) 。 You should see a new XCache Support block with opcode cache enabled.您应该会看到一个新的xcache支持座与操作码缓存启用。
  15. If you wish to set up XCache administration page, configure an alias in httpd.conf of Apache to point to the admin subdirectory within XCache.如果你想成立xcache政府网页上,配置别名在httpd.conf的Apache ,以点到管理的子目录内xcache 。 To do so, add the following line to httpd.conf (assuming your xcache source is extracted at /usr/local/src/, and you want to access admin page from /xcache-admin/ URL):这样做,添加以下行httpd.conf中(假设您的xcache来源是提取在/ usr / local /下钢骨混凝土/ ,您要访问的政府当局页从/ xcache -政府当局/网址) :

    Alias /xcache-admin/ /usr/local/src/xcache/admin/别名/ xcache管理员/ / usr / local /下钢骨混凝土/ xcache /管理/

    Then restart Apache web server.然后重新启动Apache Web服务器。 For lighttpd, add the following line instead:为lighttpd ,添加以下行,而是:

    alias.url += (”/xcache-admin/” => “/usr/share/xcache/admin/”) alias.url + = ( “ / xcache -政府当局/ ” = > “在/ usr / share / xcache /管理/ ” )

    Alternatively, you can also copy the whole “admin” directory from the “xcache” source folder to web document-root or sub-directory of your domain which is web accessible.另外,您也可以复制整个是“ admin ”目录“ xcache ”源文件夹到Web文件-根或分目录您的域名是网络访问的。 However, this method is not recommended as you may forget to update the admin page when XCache package is updated.不过,这种方法是不推荐您可能忘记,更新管理网页时, xcache包更新。

    Note: Ensure that注:确保 open_basedir protection和open_basedir保护 , if enabled, is excluded for the directory contains admin-page. ,如果启用此功能,是排除为目录包含了政府当局页。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要说明 :这是一个机器翻译网页是“按原样”提供的担保。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article英文原版的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和贡献,或取得技术的支持和帮助,在 My Digital Life Forums 我的数字生活论坛 .



Leave a Reply离开的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用这些标签:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <删除日期时间= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting订阅无评论


Custom Search

New Articles新的条款,

Incoming Search Terms for the Article传入的搜索条件文章

Thread Safety must be disbaled in php.ini 线程安全,必须disbaled在php.ini - - how to install php accelerator 如何安装PHP加速器 - - suse php accelerator 的SuSE PHP的加速器 - - "Thread Safety must be disabled in php.ini" “线程安全必须停用在php.ini ” - - accelerator x for linux 加速器的X的Linux - - linux php accelerator Linux的PHP的加速器 - - php accelerator wordpress PHP的加速器的WordPress - - install xCache 安装xcache - - linux compiling php extensions Linux的编译PHP扩展 - - compiling anastasia source code 编制美霞的源代码 - - compile form of PHP 编译形式的PHP - - compile my sources linux 编译我的消息来源的Linux - - php extention .so location inlinux PHP的延伸,所以位置inlinux - - php accelerator ubuntu PHP的加速器Ubuntu的 - - akcelerator apache akcelerator阿帕奇 - - XCache installation xcache安装 - - APC php plesk PHP中的APC plesk - - disabilitare Thread Safety in php.ini disabilitare线程安全在php.ini - - linux apache accelerator Linux的Apache的加速器 - - php gzip plesk PHP的gzip plesk - - php Zend Core 2.5 no command line PHP中的Zend核心2.5没有命令行 - - plesk php accelerator plesk PHP的加速器 - - XCache XCache-Optimizer Configure Command PHP xcache xcache -优化配置PHP的命令 - - check apc centos 检查的APC centos - - enable gzip in php.ini file 使gzip在php.ini文件 - - php العربي PHP的العربي - - +"Threadsafe PHP" +SuSe + “多线程的PHP ” +的SuSE - - centos worker php thread safe centos工人PHP的线程安全 - - centos upgrade php source "thread-safe" centos升级PHP源“线程安全” - - compiling php 5.2 suse plesk 编译PHP 5.2的SuSE plesk - - install apc on plesk 安装的APC对plesk - - php accelerator tutorial PHP的加速器补习 - - php apc 5.0.x PHP中的APC 5.0.x - - PHP fastest source code PHP中速度最快的源代码 - - XCache "php.ini" xcache “的php.ini ” - - apc accelerator phpsuexec 的APC加速器phpsuexec - - how to enable suexec+plesk+centos 如何使suexec + plesk + centos - - install accelerator apche php 安装加速器阿普谢的PHP - - phpsuexec opcode phpsuexec操作码 - - php accelerator linux PHP的加速器的Linux - - check content tar.gz inlinux 检查的内容tar.gz inlinux - - enable thread safety php centos 使线程安全的PHP centos - - php+recompile+on+plesk+linux+centos PHP的重新编译+ +对+ plesk +的Linux + centos - - php accelator PHP的accelator - - plesk php extensions plesk PHP扩展 - - XCache wordpress multiple xcache的WordPress多 - - php Thread Safety linux' PHP的线程安全的Linux ' - - linux accelerators Linux的加速器 - - php compile thread safe PHP的编译线程安全 - - How to install APC PHP Accelerator Wordpress 如何安装的APC的PHP加速器的WordPress - -