安装PHP8.0

1.安装iconv

问题

1
2
3
4
checking if iconv supports errno... no
configure: error: iconv does not support errno
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.

解决

1
2
3
4
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv && make && make install

安装libiconv又遇到问题:

1
2
In file included from progname.c:26:0:
./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)

解决

1
进入srclib目录 执行 sed -i -e '/gets is a security/d' ./stdio.in.h

安装成功后如果PHP还是报错,注意指定libiconv的位置

1
--with-iconv=/usr/local/libiconv

2.安装libtidy

1
2
yum install libtidy-devel
yum install libtidy