zl程序教程

您现在的位置是:首页 >  后端

当前栏目

[PHP问题]Cannot redeclare xxxxxx() (previously declared in C:\WWW\xxx.xxx:xxx)

PHP in Cannot xxx www 问题 declared
2023-09-27 14:27:48 时间

今天碰到一个诡异的现象,用别人家的PHP程序报错,简单记录一下:

错误提示:

Cannot redeclare xxxxxx() (previously declared in C:\WWW\geoip.inc:xxx) in <b>C:\WWW\geoip.inc</b> on line <b>xxx</b><br />

错误原因:

这个问题是因为多次引用导致重复声明

解决方法:

1.看到报错的那个文件,这里是C:\WWW\geoip.inc

2.搜索引用 geoip.inc 的文件,找到:require  ("geoip.inc"); 这样子的语句,将其改为 require_once  ("geoip.inc");

3.重新访问测试,只要还报错就说明还有地方没改好