There are questions remain, We'll search for the answers together. But one thing we known for sure,the future is not set!

【原创文章】安装WDCP 出现“Install Error: php configure err”错误的原因和解决办法

系统防护 百蔬君 4115℃ 已收录 0评论

这几天因为centos7的分区空间没有分配好,所以就删除了wdcp,分配好空间之后再安装wdcp就提示一堆的错误,具体信息如下:

installing php...
make: *** No rule to make target `clean'.  Stop.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
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 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 how to run the C preprocessor... cc -E
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... no
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... gawk
checking for bison... bison -y
checking for bison version... 2.4 (ok)
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking whether to enable computed goto gcc extension with re2c... no
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags... -pthread
checking for pthreads_lib... 

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... 

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /www/wdlinux/apache/bin/apxs follows:
./configure: line 8426: /www/wdlinux/apache/bin/apxs: No such file or directory
configure: error: Aborting


x86_64
CentOS release 6.8 (Final)
----Install Error: php configure err -----------

刚刚开始,我也是张二摸不着头脑,跑去仔细看了lib/php.sh

脚本中关于apxs的配置如下

[ $SERVER == "apache" -o $SERVER == "na" ] && NV="--with-apxs2=$IN_DIR/apache/bin/apxs"
    cd php-$PHP_VER/

在这里$IN_DIR变量的值为/www/wdlinux,这些都是ok的,按照提示查看,/www/wdlinux/apache/bin/apxs这个目录确实不存在。

这个错误在wdcp官方论坛有好几个朋友提到,比如https://www.wdlinux.cn/bbs/thread-61805-1-1.html和其它几个帖子,但是没有人回答。

造成这个问题的原因其实是官方的问题,官方在“wdcp_v3.2正式版发布了”(https://www.wdlinux.cn/bbs/thread-57643-1-1.html)一文中是这样建议用户卸载wdcp的。

<span style="color: #ff0000;">卸载方法</span>
rm -fr /www/wdlinux
reboot

当时就觉得这样不妥,但是由于没有遇到什么实际影响我也就没有深究,直到我遇到php无法安装的这个问题。

没办法,只能研究wdcp的安装文件lanmp.sh,在这里发现wdcp其实是有卸载命令的。

if [ "$1" == "un" -o "$1" == "uninstall" ]; then
    service httpd stop
    service nginxd stop
    service mysqld stop
    service pureftpd stop
    service wdcp stop
    mkdir /www/backup
    bf=$(date +%Y%m%d)
    tar zcf /www/backup/mysqlbk_$bf.tar.gz /www/wdlinux/mysql/{var,data}
    rm -fr /www/wdlinux
    rm -f inf/*.txt
    reboot
    exit
fi

造成php安装错误的原因就是因为很多初始化和前期工作没有做,前面的程序没装,后面的程序要用,当然会出问题了。从这个代码也可以看出来,卸载wdcp不仅仅要删除 /www/wdlinux目录,还要删除inf文件夹中相关txt配置文件。

解决办法也就简单了,清空inf文件夹中的txt文件,或者直接运行一次卸载命令:sh lanmp.sh un

然后再安装wdcp就顺畅了!!

如果安装wdcp出现“apache.sh line 2:syntax error near unexpected token `$'{\r”””类似的错误,

这是由于apache.sh中出现了很多换行符造成的,至于原因,我也没有想明白,好像没有动过这个文件。解决办法就是替换掉这些换行符就行了。

运行命令:
sed 's/\r//' apache.sh > apachenew.sh
cp apachenew.sh apache.sh

然后就ok了

转载请注明:百蔬君 » 【原创文章】安装WDCP 出现“Install Error: php configure err”错误的原因和解决办法

喜欢 (4)or分享 (0)
发表我的评论
取消评论

请证明您不是机器人(^v^):

表情