zoukankan      html  css  js  c++  java
  • CentOS 安装eaccelerator PHP加速

    1.编译eaccelerator

    Warning: Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (.:/tmp/) in Unknown on line 0
    Fatal error: Can’t load /XX/index.php, open_basedir restriction. in Unknown on line 0
    出现了很多次这样的问题了,感觉都无从下手,总觉得与系统和php有关, 今天又出现了, 想来想去都觉得不奇怪, 后面开始重新编译php, php的扩展都没编译,发现设置open_basedir的时候,却没有出错^^^ , 从这个信息觉得有些可以利用的,把自己方案所需的扩展都安装进去,重启apache的时候,却发现有出现这个错误, 把php.ini中设置的扩展一个一个的关闭,开始排查,后面吧eaccelerator注释掉后,重启apache并没有出现错误, 定位问题出现eaccelerator, 在用google查了下,发现eaccelerator 0.9.6后的版本跟以前的有些改变,把open_basedir给限制了,这时我们要把限制去掉才行
    下载eaccelerator 0.9.6后先不要安装,解包后找到eaccelerator.c这个文件,打开第1156行,这样的:
    if (PG(open_basedir) && php_check_open_basedir(realname TSRMLS_CC)) {
    修改成:
    if (PG(open_basedir) && php_check_open_basedir(file_handle->filename TSRMLS_CC)) {
    修改后在进行编译,就ok了

    phpize
    ./configure
    make

    2.安装

    make install
    会将eaccelerator编译到目标路径

    3.设置
    拷贝eaccelerator.ini到 /etc/php.d/eaccelerator.ini

    extension=”eaccelerator.so”
    eaccelerator.shm_size=”16″
    eaccelerator.cache_dir=”/tmp/eaccelerator”
    eaccelerator.enable=”1″
    eaccelerator.optimizer=”1″
    eaccelerator.check_mtime=”1″
    eaccelerator.debug=”0″
    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″

  • 相关阅读:
    KindEditor的使用
    python过滤文件中特殊标签
    django中orm的简单操作
    django中models联合唯一unique_together
    博客当中的文章分类以及归档
    zabbix前端添加平台脚本监控
    django重写form表单中的局部钩子函数
    input获取、失去焦点对输入内容做验证
    django admin后台的简单使用
    django中博客后台将图片上传作为用户头像
  • 原文地址:https://www.cnblogs.com/sxlfybb/p/2295644.html
Copyright © 2011-2022 走看看