PHP 包含未在 WordPress 中加载
我们在 WordPress 中构建的网站存在一些问题。当您登陆网站的主页时,某些 include
文件在首次登陆该页面时不会加载,并且在查看该页面的过程中也会间歇性地加载。我想知道有一个好的方法来调试这些包含(PHP 日志中没有错误)或者追踪这个问题的最佳实践是什么。我不知所措。
我知道 WP 钩子比包含更推荐,但这个主题是使用钩子传递给我们的。
注意:Firebug 控制台不提供任何错误。
非常感谢任何和所有的建议,我对此感到迷失。
We have a site that we have built in WordPress that is having some issues. When you land on the home page of the site there are certain include
files that do not load upon first landing on the page and it also happens intermittently throughout viewing this page. I would like to know it there is a good way to debug these includes (no errors in PHP log) or what best practice would be to trace down this issue. I am at a loss.
I know WP hooks are recommended over includes but this theme was passed off to us using hooks.
Note: Firebug Console does not provide any errors.
Any and all advice is greatly appreciated, I am lost with this one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能是 PHP 的内存问题。尝试将 PHP 的 memory_limit 设置增加到 64M。将以下内容放入 .htaccess 中:
php_value memory_limit 64M
同时验证您的 HTML 并查看是否存在任何错误,例如未关闭的 div。
检查您的 JavaScript 是否有任何可以动态删除部分内容的内容。
This can be a memory problem with PHP. Try increasing PHP's memory_limit setting to 64M. Put the following inside .htaccess:
php_value memory_limit 64M
Also validate your HTML and see if there are any errors like unclosed divs.
Check your javascripts for anything that can remove parts of your content dynamically.
您可以使用 xdebug 之类的工具运行它,以便更好地了解正在发生的情况。
一个更简单的选择是打开错误报告,这样您就可以看到页面上发生的情况,而不是通过错误日志进行搜索:
ini_set('display_errors',1);
错误报告(E_ALL | E_STRICT);
将它们放在 load.php 的顶部
You could run it using something like xdebug to give you a better idea of what is going on.
An easier alternative would be to turn error reporting on so you can see what is happening on page rather than trawling through error logs:
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
Put those at the top of load.php