500内部服务器错误? [英] 500 Internal Server Error?

查看:64
本文介绍了500内部服务器错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我把我的项目 php+smarty+mysql 放在了我的 httpd 服务器中.但是我遇到了一个错误:

Recently, I put my project which is php+smarty+mysql in my httpd server. But I encountered an error that says:

500 Internal Server Error

我的操作系统是archlinux,httpd服务器和php是这样安装的:

My OS is archlinux, and the httpd server and php were installed like this:

sudo pacman -S apache php

如果我使用包含以下内容的测试本机 php 文件:

If I use a test native php file which contains the following:

  <html>
    <head>
    <title>PHP Test Page</title>
    </head>
    <body>
    This is Arch Linux, running PHP.
    <?php
      phpinfo();
    ?>
    </body>
    </html>

它运行正常.它告诉我 php 可以正常工作.但是为什么我的带有 smarty 的项目不起作用?有没有人遇到过这个问题?

it runs correctly. It tells me that the php can work well. But why is my project with smarty not working? Is there any one who has encountered this problem?

推荐答案

根据您提供的信息,很难说.

With the info you provided it's difficult to say.

发生错误 500 是因为您在应该生成页面的代码中犯了一些错误,或者代码生成了一些未处理的异常.我的建议是访问出现 500 错误的页面,然后尝试注释掉所有代码.看看问题是否仍然存在.如果不是,请取消注释代码,直到找到导致错误的关键部分.可能是任何东西,打字错误,找不到文件,逻辑错误,任何东西.

Error 500 happens because you did some error in the code that is supposed to produce the page, or the code generates some unhandled exception. My suggestion is to visit the page that gives you the 500 error, and then try to comment out all your code. See if the issue is still present. If not, uncomment the code until you find the critical part that originates the error. Could be anything, a typo, a file not found, a logical error, anything.

此外,如果您可以阅读网络服务器日志,请检查它们.

Also, check in the webserver logs, if you can read them.

这篇关于500内部服务器错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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