VPS侦探论坛

 找回密码
 注册
查看: 4892|回复: 5

请问linode如何安装php的tidy模块?

[复制链接]
发表于 2015-5-31 18:07:19 | 显示全部楼层 |阅读模式

我试过下面的方法都无效:tar -xvzf 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 /root/tidy-1.2/libtool --mode=link cc -DPHP_ATOM_INC -I/root/tidy-1.2/include -I/root/tidy-1.2/main -I/root/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   -o tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/tidy-1.2/modules  tidy.lo -ltidy
cc -shared  .libs/tidy.o  -ltidy  -Wl,-soname -Wl,tidy.so -o .libs/tidy.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../libtidy.so when searching for -ltidy
/usr/bin/ld: skipping incompatible /lib/libtidy.so when searching for -ltidy
/usr/bin/ld: skipping incompatible /usr/lib/libtidy.so when searching for -ltidy
/usr/bin/ld: cannot find -ltidy
collect2: error: ld returned 1 exit status
make: *** [tidy.la] Error 1
安装不成功,phpinfo里面没有tidy模块
----------------------------------------------------------------------------
用yum install libtidy libtidy-devel安装出现下面这个情况
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
也安装不成功,phpinfo里面没有tidy模块

----------------------------------------------------------------------------
yum install php-tidy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
No package php-tidy available.
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-5-31 22:02:33 | 显示全部楼层


按返回的错误信息看应该是没安装libtidy
yum install libtidy libtidy-devel 只是安装lib库不是安装php的tidy模块,安装好lib库才能安装php的tidy模块

php模块不能使用yum或apt-get安装,只能按https://www.vpser.net/manage/lnmp-php-install-ext.html这个安装
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-6-1 13:09:19 | 显示全部楼层

军哥新版本把这个库添加到php吧,由于装不上我在网上找了个php类代替这个库的功能  悲催
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2015-6-1 13:16:14 | 显示全部楼层



[root@localhost ext]# tar -xvzf tidy-1.2.tgz
package.xml
tidy-1.2/config.m4
tidy-1.2/tidy.c
tidy-1.2/php_tidy.h
tidy-1.2/CREDITS
tidy-1.2/README
tidy-1.2/TODO
tidy-1.2/examples/cleanhtml.php
tidy-1.2/tests/001.phpt
tidy-1.2/tests/002.phpt
tidy-1.2/tests/003.phpt
tidy-1.2/tests/004.phpt
tidy-1.2/tests/005.phpt
tidy-1.2/tests/005.html
tidy-1.2/tests/006.phpt
tidy-1.2/tests/007.phpt
[root@localhost ext]# cd tidy-1.2
[root@localhost tidy-1.2]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
[root@localhost tidy-1.2]# ./configure --with-php-config=/usr/local/php/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -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
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for TIDY support... yes, shared
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-6-1 13:16:54 | 显示全部楼层

make && make install会出错

/bin/sh /usr/local/php/include/php/ext/tidy-1.2/libtool --mode=compile cc  -I. -I/usr/local/php/include/php/ext/tidy-1.2 -DPHP_ATOM_INC -I/usr/local/php/include/php/ext/tidy-1.2/include -I/usr/local/php/include/php/ext/tidy-1.2/main -I/usr/local/php/include/php/ext/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/php/include/php/ext/tidy-1.2/tidy.c -o tidy.lo
mkdir .libs
cc -I. -I/usr/local/php/include/php/ext/tidy-1.2 -DPHP_ATOM_INC -I/usr/local/php/include/php/ext/tidy-1.2/include -I/usr/local/php/include/php/ext/tidy-1.2/main -I/usr/local/php/include/php/ext/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/php/include/php/ext/tidy-1.2/tidy.c  -fPIC -DPIC -o .libs/tidy.o
/usr/local/php/include/php/ext/tidy-1.2/tidy.c: In function 鈥榸m_info_tidy鈥?
/usr/local/php/include/php/ext/tidy-1.2/tidy.c:387:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     sprintf(buf, "%d", (int)opt_value);
                        ^
/bin/sh /usr/local/php/include/php/ext/tidy-1.2/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/php/include/php/ext/tidy-1.2/include -I/usr/local/php/include/php/ext/tidy-1.2/main -I/usr/local/php/include/php/ext/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   -o tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/php/include/php/ext/tidy-1.2/modules  tidy.lo -ltidy
cc -shared  .libs/tidy.o  -ltidy  -Wl,-soname -Wl,tidy.so -o .libs/tidy.so
/usr/bin/ld: cannot find -ltidy
collect2: error: ld returned 1 exit status
make: *** [tidy.la] Error 1

军哥运维代购:http://shop63846532.taobao.com/

发表于 2015-6-1 13:53:50 | 显示全部楼层

只加常用的不常用的不加

find / -name libtidy.so 看一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-16 14:40 , Processed in 0.026985 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表