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