简体   繁体   English

为什么我在共享的免费服务器上收到这个奇怪的 500 错误

[英]Why i am getting this weird 500 error on a shared free server

I have a project(idea) I've been developing my idea about 2 months and i am ready to release beta version of my application online.我有一个项目(想法)我已经开发了大约 2 个月的想法,我准备在线发布我的应用程序的测试版。

Here is the thing my project 100% works fine in my ' localhost ' sever;这是我的项目 100% 在我的“本地主机”服务器中正常工作的东西; and i have done my best to code standard.我已尽最大努力编写标准。 About an hour ago i upload my project on a free host server大约一个小时前,我将我的项目上传到免费的主机服务器上
http://www.serversfree.com/ http://www.serversfree.com/
for online testing.用于在线测试。 there is a weird '500' error, i have tried to track it so i start from beginning by putting " die() " statement in my codes.有一个奇怪的“500”错误,我试图跟踪它,所以我从头开始将“ die() ”语句放入我的代码中。 my project architecture is based on MVC model so every request gets pass through the /public_html/default.php file我的项目架构基于 MVC 模型,因此每个请求都通过/public_html/default.php文件

I put a die('test') statement in the 1st line of my /public_html/default.php the obvious result is that for every request the test statement will flush-out and the php interpreter halts.我在/public_html/default.php的第一行中放置了一个die('test')语句,显而易见的结果是,对于每个请求,测试语句都将刷新并且 php 解释器停止。

The problem is: The result of this link问题是:这个链接的结果

http://life-journal.bugs3.com/login http://life-journal.bugs3.com/login

is different from this one与这个不同

http://life-journal.bugs3.com/ http://life-journal.bugs3.com/

Also i have viewed my site's log file but there was no error related to why i am getting this weird 500 error我还查看了我网站的日志文件,但没有与为什么我收到这个奇怪的 500 错误相关的错误

WHY and How can i solve this to run my online testing?为什么以及如何解决这个问题来运行我的在线测试?

Thanks in advance.提前致谢。


The top part of my /public_html/default.php file is something like this(NOW) :我的/public_html/default.php文件的顶部是这样的(现在):

die('test');

session_start();

define(DEVELOPMENT, 'DEVELOPMENT');

define(PRODUCTION, 'PRODUCTION');

If You go for http://life-journal.bugs3.com/default.php/login there is no error.如果你去http://life-journal.bugs3.com/default.php/login没有错误。 My guess is that your hosting doesn't offer mod_rewrite but You should double check Your .htaccess我的猜测是您的主机不提供 mod_rewrite 但您应该仔细检查您的 .htaccess

Check out the logs, possibly you ran into a PHP error.查看日志,您可能遇到了 PHP 错误。 Also, it looks like, that error reporting is turned off, so for testing reasons, you can enable it on the first line of PHP code:此外,看起来错误报告已关闭,因此出于测试原因,您可以在 PHP 代码的第一行启用它:

ini_set("display_errors", 1);

If error reporting is turned on (not common on production servers), then it is a server misconfiguration issue, and you should probably consult your hosting provider, otherwise the PHP error will lead you to the cause of the issue.如果打开了错误报告(在生产服务器上不常见),那么这是服务器配置错误的问题,您可能应该咨询您的托管服务提供商,否则 PHP 错误将引导您找到问题的原因。

Thank you guys You posts just reminded me that i have not changed my .htaccess谢谢你们 你的帖子只是提醒我我没有改变我的 .htaccess

RewriteRule ^(.+)$ /index.php/$1重写规则 ^(.+)$ /index.php/$1

to

RewriteRule ^(.+)$ /default.php/$1重写规则 ^(.+)$ /default.php/$1

I am really thankful我真的很感谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM