include_once / require_once / include / require太多了 [英] Too many include_once/require_once/include/require

查看:115
本文介绍了include_once / require_once / include / require太多了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于许多包含的文件创建一个错误,而不是显示内容它只显示空白或其中一个文件有错误,如脚本末尾没有逗号不显示错误打印,如致命错误或语法错误PHP?

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?

我有点担心,因为我现在在一个网站上工作,有近20个文件要包含在不同的目录中。

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....

推荐答案

听起来你关闭了错误报告,我是不确定,如果这是你的问题,但是;-)。 Put

Sounds like you have error reporting turned off, i am not sure, if this is your question, though ;-). Put

ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);

如果您想调试并且不想更改php,则在脚本的最开头。 ini设置。在生产站点上进行这样的调试是出于明显的原因,不建议这样做(每个访问者都可以看到错误,包括合理的信息,错误可能包含)。

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).

它没有在您的申请中有多少包含 - 20不多,顺便说一句。 - 你总是会得到错误以及它出现在哪一行和哪个文件中的信息......

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 ...

这篇关于include_once / require_once / include / require太多了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆