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

2015-12-02 18:00:16 +08:00
 theKingOfTerrors

我想安装 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

2942 次点击
所在节点    PHP
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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/240646

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX