网站受到病毒攻击,但没有显示任何内容

发布于 2024-09-02 02:07:40 字数 158 浏览 1 评论 0原文

我有一个用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谈下烟灰 2024-09-09 02:07:40

如果您确定自己感染了病毒,那么我无法帮助您。

如果有可能它不是病毒...

如果您正在运行 PHP,“白色空白页”可能是语法错误的症状。

您的代码中的某个地方可能存在拼写错误。

确保您可以发现错误

尝试:

暂时将其添加到脚本的顶部

<?php

//ensure errors are displayed
ini_set('display_errors', 1);

//show all type of errors apart from Notices
error_reporting(E_ALL ^E_NOTICE);

也可以尝试从纯 PHP 脚本的底部删除结束 php 标签:

即更改:

<?php

//i am 100% php

?>

显然

<?php

//i am 100% php

,如果将 php 与 html 分开,请保留结束 php 标签。

这是一种常见的编码实践。

例如,参见:
- http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general

开始调试

一点蛮力可能会有所帮助。从脚本顶部开始,添加类似以下内容:

<?php

//ensure errors are displayed
ini_set('display_errors', 1);

//show all type of errors apart from Notices
error_reporting(E_ALL ^E_NOTICE);

echo('hello - i got this far');
exit;

//...other code

刷新页面。如果你能看到

hello - i got this far

那么你就知道这是一个你可以解决的问题。

整理/注释掉上面提到的那些代码行。

然后查看:

调试和科学方法

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:

Temporally add this to the top of your script

<?php

//ensure errors are displayed
ini_set('display_errors', 1);

//show all type of errors apart from Notices
error_reporting(E_ALL ^E_NOTICE);

Also try removing the closing php tags from the bottom of pure-php scripts:

i.e change:

<?php

//i am 100% php

?>

to

<?php

//i am 100% php

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:

<?php

//ensure errors are displayed
ini_set('display_errors', 1);

//show all type of errors apart from Notices
error_reporting(E_ALL ^E_NOTICE);

echo('hello - i got this far');
exit;

//...other code

Refresh the page. If you can see

hello - i got this far

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

∞梦里开花 2024-09-09 02:07:40

检查服务器的错误日志和 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文