CodeIgniter 500 内部服务器错误

问题描述:

我下载了一个使用 CodeIgniter 编写的 PHP 脚本.当我从 localhost 运行它时,转到 admin 文件夹,它再次显示 localhost.此外,当从我的 Web 主机运行时,它显示 500 内部服务器错误.

I downloaded a PHP script written using CodeIgniter. when I run it from the localhost, on going to the admin folder, it shows localhost again. Also when running from my web host, it shows a 500 Internal Server Error.

我从 http://localhost/myproj 运行该站点 它有效.然后,当我尝试转到位于 http://localhost/myproj/administrator 的管理页面时,它给出了 500 内部服务器错误.

I run the site from http://localhost/myproj It works. Then when I try to go to the admin page which is at http://localhost/myproj/administrator, it gives a 500 Internal Server Error.

我在这里读到这可能是由于 .htaccess 文件中的错误代码造成的.这是我现在的 .htaccess 文件

I read here that this might be due to a wrong code in the .htaccess file. This is my present .htaccess file

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

# Without mod_rewrite, route 404's to the front controller
ErrorDocument 404 /index.php

请帮帮我.我知道这可能是一个很小的问题,但我无法找到错误.

Please help me. I know it might be a very small problem, but I'm unable to find the error.

500错误的问题(使用CodeIgniter),不同apache设置,PHP配置出错时显示500错误.

The problem with 500 errors (with CodeIgniter), with different apache settings, it displays 500 error when there's an error with PHP configuration.

以下是它如何使用 CodeIgniter 触发 500 错误:

Here's how it can trigger 500 error with CodeIgniter:

  1. 脚本错误(PHP 配置错误、缺少包等...)
  2. PHP致命错误"

请检查您的 apache 错误日志,那里应该有一些有趣的信息.

Please check your apache error logs, there should be some interesting information in there.