[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

 

转载于:https://www.cnblogs.com/Renyi-Fan/p/9744035.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值