网站受到病毒攻击,但没有显示任何内容
我有一个用 cakePHP 开发的 Web 应用程序,但从上周开始,该网站受到病毒影响,并且没有显示任何页面。即使我们查看源代码,也没有任何内容可显示。
我检查了index.php,没有多余的条目。有人可以帮我找出解决方案吗?并且,我怎样才能防止这些病毒攻击?
提前致谢
I have a web application which is developed in cakePHP, but from last few week, a virus is affected to the site and its not showing any pages. even if we go to the source code, nothing is there to display.
I have checked the index.php, there is no extra entry. Can some help me to find out the solution. and, how can i prevent these virus attacks?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确定自己感染了病毒,那么我无法帮助您。
如果有可能它不是病毒...
如果您正在运行 PHP,“白色空白页”可能是语法错误的症状。
您的代码中的某个地方可能存在拼写错误。
确保您可以发现错误
尝试:
打开“显示错误”
设置“错误报告”以显示所有类型的错误
暂时将其添加到脚本的顶部
也可以尝试从纯 PHP 脚本的底部删除结束 php 标签:
即更改:
显然
,如果将 php 与 html 分开,请保留结束 php 标签。
这是一种常见的编码实践。
例如,参见:
- http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general
开始调试
一点蛮力可能会有所帮助。从脚本顶部开始,添加类似以下内容:
刷新页面。如果你能看到
那么你就知道这是一个你可以解决的问题。
整理/注释掉上面提到的那些代码行。
然后查看:
调试和科学方法
If you know for sure that you have a virus, then I cannot help you.
If there is a chance that its not a virus...
If you are running PHP, a 'white blank page' can be a symptom of a syntax error.
Somewhere in your code there may be a typo.
Ensure you can spot errors
Try:
turning on 'display errors'
setting 'error reporting' to display all type of errors
Temporally add this to the top of your script
Also try removing the closing php tags from the bottom of pure-php scripts:
i.e change:
to
Obviously, keep a closing php tag if it separates php from html.
This is a common coding-practice.
See, for example:
- http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general
Start debugging
A bit of brute force might help. Start at the top of the script and add something like:
Refresh the page. If you can see
Then you know that it is a problem that you can solve.
Tidy-up / comment-out those lines of code, mentioned above.
Then look into:
Debugging And The Scientific Method
检查服务器的错误日志和 PHP 错误日志。浏览器中没有输出通常表明脚本存在问题,并且“display_errors”已关闭,因此您不会收到任何信息。
Check both the server's error logs and the PHP error log. No output in the browser generally indicates there's a problem with the script and "display_errors" is off, so you get nothing sent.