include_once/require_once/include/require 过多
由于许多包含的文件会产生错误,例如显示内容,它只显示空白,或者其中一个文件有错误,例如脚本末尾没有逗号,不显示错误打印,例如 PHP 中的致命错误或语法错误?
我有点担心,因为我现在正在一个网站上工作,该网站有近 20 个来自不同目录的文件要包含。
我将这些文件分开,就像包含页面函数、会话函数、图像函数等的文件一样。
我需要任何人的建议。专家还是非专家我真的需要知道这一点......
Due to many included files create an error like instead showing the contents it only shows blank or one of the files has an error like no comma in the end of the script do not shows an error print like fatal error or syntax error in PHP?
I'm a bit worried cause i working on a site right now that has almost 20+ files to include from different directory.
I separated the files like a file that contains the page function, session functions, image function and other more.
I need some advice from anyone. Experts or not experts I really need to know this....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您已关闭错误报告,但我不确定这是否是您的问题;-)。 请将其放在
如果您想调试并且不想更改 php.ini 设置, 脚本的最开头。不过,出于明显的原因,不建议在生产站点上进行这样的调试(每个访问者都可以看到错误,包括错误可能包含的合理信息)。
您的应用程序中有多少个包含项并不重要——顺便说一句,20 个并不算多。 -- 您总是会得到错误以及错误发生在哪一行和哪个文件中的信息......
Sounds like you have error reporting turned off, i am not sure, if this is your question, though ;-). Put
at the very beginning of your script if you want to debug and don't want to change php.ini settings. Debugging like this on a production site is for obvious reasons not recommended, though (every visitor can see the error including sensible information, the error might contain).
It does not matter how many includes you have in your application -- 20 are not much, btw. -- you will always get the error together with the information in which line and which file it occured ...