微信扫一扫打赏支持

[thinkphp使用phpspreadsheet时出现]Cannot redeclare xxxxxx() (previously declared in C:\WWW\xxx.xxx:xxx)

[thinkphp使用phpspreadsheet时出现]Cannot redeclare xxxxxx() (previously declared in C:\WWW\xxx.xxx:xxx)

一、总结

一句话总结:Cannot redeclare Complex\abs() (previously declared in D:\software\code\phpStudy2018\PHPTutorial\WWW\github\m_Orchestrate\m_Orchestrate\vendor\markbaker\complex\classes\src\functions\abs.php:26)

错误提示:

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.重新访问测试,只要还报错就说明还有地方没改好

 

1、我出现这样问题的原因:?

thinkphp里面其实已经默认帮我们把插件vendor里面的东西都加载进了系统,

而我在第七行中再加载一次,那么肯定会造成重复加载的问题

1 // [ 应用入口文件 ]
2 
3 // 定义应用目录
4 define('APP_PATH', __DIR__ . '/../application/');
5 // 加载框架引导文件
6 require __DIR__ . '/../thinkphp/start.php';
7 //require __DIR__ . '/../vendor/autoload.php';

 

 

 

 

 

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

版权声明:本文为博主原创文章,未经博主允许可以随意转载。 https://blog.csdn.net/Kingsley_zhong/article/details/46328465

今天碰到一个诡异的现象,用别人家的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.重新访问测试,只要还报错就说明还有地方没改好

 

 

参考:[PHP问题]Cannot redeclare xxxxxx() (previously declared in C:\WWW\xxx.xxx:xxx) - 御风的博客 - CSDN博客
https://blog.csdn.net/kingsley_zhong/article/details/46328465

 

posted @ 2018-10-05 01:59  范仁义  阅读(6426)  评论(0编辑  收藏  举报