zoukankan      html  css  js  c++  java
  • 加速器eaccelerator不兼容高版本php

    话说PHP官方发布PHP5.4已经有一阵了,根据使用的情况来看,似乎还是很不错的。从初始发布到现在升级到的PHP5.4.4,修正不少的Bug。PHP5.4新的版本,除了提供了更多新的特性,还有大幅的效率提升。这个版本趋于稳定之后,我决定把我的服务器升级到PHP5.4.4。

    服务器上的软件包,一直以来都是编译安装,因此对于这些东西自己也是比较可控的。从PHP官方网站下载最新的源代码包,解压缩并且安装,这没有什么特别的。以下是我使用的安装编译参数:

    ./configure --prefix=/usr/local/php-5.4.4/ --with-config-file-path=/usr/local/php-5.4.4/etc --with-mysql --with-mysqli --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pdo-mysql
    make ZEND_EXTRA_LIBS='-liconv'
    make install

    在安装eaccelerator的时候,出现了奇葩的错误:
    /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 1

    看报错情况来看,eaccelerator似乎与新版本的PHP不兼容。于是分别尝试了另外两个加速器,APC和xcache。

    安装APC时出现了一个比较纠结的问题,启动php-fpm时会报出php-fpm Segmentation fault错误,后来在网上搜索了之后没有发现解决方案,之后便选定了xcache。看到官方网站上最近发布的2.0版本,已经完全支持了PHP5.4,于是下载回来编译安装,一切正常!

    之前看过一个关于三种加速器性能比较的文章(传送门:《关于PHP加速eAccelerator、APC和Zend Optimizer》),发现三者的悬殊较小,eaccelerator以微弱优势胜出。看来,选择xcache也是个不错的选择。

  • 相关阅读:
    hdu 2896 AC自动机模版题
    快递公司送货员送到货时,打电话通知客户来取的改进
    Scala数据类型中的Symbol(符号文本)
    hdu 3065 AC自动机模版题
    Oracle DB 复制数据库
    Java打包生成exe(使用exe4j和inno setup)
    C#的Lambda表达式嵌套例子
    WPF设置控件获得焦点FocusManager
    Winform给TextBox设置默认值(获取焦点后默认值消失)
    使用signtool.exe来验证程序的数字签名是否成功(命令行)
  • 原文地址:https://www.cnblogs.com/fjping0606/p/4760437.html
Copyright © 2011-2022 走看看