关于require的使用有关问题

WBOY
Release: 2016-06-13 12:53:31
Original
863 people have browsed it

关于require的使用问题
我的一个test.php文件引用了A.php,b.php和c.php文件,这样test.php无法正常运行,也不提示错误(坑爹的说,为毛就是不提示错误呢),这时去掉b.php和c.php的引用,test.php可以正常运行,即:只有A.php的时候可以正确运行,当然路径肯定是正确,再继续加上b.php,又无法运行了,此时我又单独运行b.php,坑爹的竟然能正常运行。请问这是肿么啦?


------解决方案--------------------
有错却又不提示错误,是因为你没有打开错误显示功能

只有A.php的时候可以正确运行,再继续加上b.php,又无法运行了
可能的原因是 b.php 中重复声明了 a.php 中的函数或类

你没有给出代码,无法给出进一步的建议
------解决方案--------------------
可以试试  ?>  换成 我碰到过一次这样的情况
------解决方案--------------------
常量 IN_DESTOON 在 common.inc.php 中定义
但 test.php 中引用 common.inc.php 在 config.inc.php 之后
config.inc.php 中的 defined('IN_DESTOON') or exit('Access Denied'); 将因为常量 IN_DESTOON 未定义而导致程序终止

因为 common.inc.php 已引用了 config.inc.php,所以 test.php 中的 require 'config.inc.php'; 应删去
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!