V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
theKingOfTerrors
V2EX  ›  PHP

HTML Tidy 扩展安装出现错误,请大神指教

  •  
  •   theKingOfTerrors · 2015-12-02 18:00:16 +08:00 · 2958 次点击
    这是一个创建于 3297 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想安装 HTML Tidy 在 centos 6.5 上,我的 php 环境是 5.6 , tidy 的安装包是 tidy-1.2.tgz
    我的安装命令是:
    tar zxvf tidy-1.2.tgz
    cd tidy-1.2
    /usr/local/php/bin/phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config
    make && make install
    报错信息如下:
    /bin/sh /usr/local/src/tidy-1.2/libtool --mode=compile cc -I. -I/usr/local/src/tidy-1.2 -DPHPATOM_INC -I/usr/local/src/tidy-1.2/include -I/usr/local/src/tidy-1.2/main -I/usr/local/src/tidy-1.2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/tidy-1.2/tidy.c -o tidy.lo
    mkdir .libs
    cc -I. -I/usr/local/src/tidy-1.2 -DPHP_ATOM_INC -I/usr/local/src/tidy-1.2/include -I/usr/local/src/tidy-1.2/main -I/usr/local/src/tidy-1.2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/tidy-1.2/tidy.c -fPIC -DPIC -o .libs/tidy.o
    /usr/local/src/tidy-1.2/tidy.c:32:23: error: safe_mode.h: No such file or directory
    /usr/local/src/tidy-1.2/tidy.c:49: error: expected ‘=’, ‘,’, ‘;’, ‘ asm ’ or ‘
    attribute_’ before ‘ tidy_functions ’
    /usr/local/src/tidy-1.2/tidy.c:83: error: ‘ tidy_functions ’ undeclared here (not in a function)
    /usr/local/src/tidy-1.2/tidy.c: In function ‘ php_tidy_quick_repair ’:
    /usr/local/src/tidy-1.2/tidy.c:287: error: ‘ struct _php_core_globals ’ has no member named ‘ safe_mode ’
    /usr/local/src/tidy-1.2/tidy.c:287: error: ‘ CHECKUID_CHECK_FILE_AND_DIR ’ undeclared (first use in this function)
    /usr/local/src/tidy-1.2/tidy.c:287: error: (Each undeclared identifier is reported only once
    /usr/local/src/tidy-1.2/tidy.c:287: error: for each function it appears in.)
    /usr/local/src/tidy-1.2/tidy.c: In function ‘ zm_info_tidy ’:
    /usr/local/src/tidy-1.2/tidy.c:387: warning: cast from pointer to integer of different size
    /usr/local/src/tidy-1.2/tidy.c: In function ‘ zif_tidy_load_config ’:
    /usr/local/src/tidy-1.2/tidy.c:742: error: ‘ struct _php_core_globals ’ has no member named ‘ safe_mode ’
    /usr/local/src/tidy-1.2/tidy.c:742: error: ‘ CHECKUID_CHECK_FILE_AND_DIR ’ undeclared (first use in this function)
    /usr/local/src/tidy-1.2/tidy.c: In function ‘ zif_tidy_load_config_enc ’:
    /usr/local/src/tidy-1.2/tidy.c:765: error: ‘ struct _php_core_globals ’ has no member named ‘ safe_mode ’
    /usr/local/src/tidy-1.2/tidy.c:765: error: ‘ CHECKUID_CHECK_FILE_AND_DIR ’ undeclared (first use in this function)
    /usr/local/src/tidy-1.2/tidy.c: In function ‘ zif_tidy_save_config ’:
    /usr/local/src/tidy-1.2/tidy.c:811: error: ‘ struct _php_core_globals ’ has no member named ‘ safe_mode ’
    /usr/local/src/tidy-1.2/tidy.c:811: error: ‘ CHECKUID_CHECK_FILE_AND_DIR ’ undeclared (first use in this function)
    make: *** [tidy.lo] Error 1

    1 条回复    2017-05-23 15:19:17 +08:00
    jiangbianwanghai
        1
    jiangbianwanghai  
       2017-05-23 15:19:17 +08:00
    php 手册说的非常清楚

    This extension is bundled with PHP 5 and greater, and is installed using the --with-tidy configure option.

    此扩展程序与 PHP 5 及更高版本捆绑在一起,并使用--with-tidy configure 选项进行安装。

    所以,重装一下 php 即可,记得--with-tidy
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   922 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 22:46 · PVG 06:46 · LAX 14:46 · JFK 17:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.