【问题标题】:500 Internal Server Error in Deploying Codeigniter部署 Codeigniter 时出现 500 内部服务器错误
【发布时间】:2013-03-09 03:37:41
【问题描述】:

我正在尝试部署我的网站,但我不断收到 500 内部服务器错误。我可以很好地打开主页,但是当我想打开另一个菜单选项卡时,它一直显示 500 Internal Server Error。我也检查了日志,但似乎没有找到任何线索。这是我的服务器错误日志显示的内容:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

DEBUG - 2013-03-20 11:36:44 --> Config Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Hooks Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Utf8 Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> UTF-8 Support Enabled 
DEBUG - 2013-03-20 11:36:44 --> URI Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Router Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> No URI present. Default controller set. 
DEBUG - 2013-03-20 11:36:44 --> Output Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Security Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Input Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Global POST and COOKIE data sanitized 
DEBUG - 2013-03-20 11:36:44 --> Language Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Loader Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Config file loaded: application/config/asset.php 
DEBUG - 2013-03-20 11:36:44 --> Helper loaded: asset_helper 
DEBUG - 2013-03-20 11:36:44 --> Helper loaded: string_helper 
DEBUG - 2013-03-20 11:36:44 --> Helper loaded: url_helper 
DEBUG - 2013-03-20 11:36:44 --> Helper loaded: form_helper 
DEBUG - 2013-03-20 11:36:44 --> Helper loaded: text_helper 
DEBUG - 2013-03-20 11:36:44 --> Database Driver Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Native_session Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Form Validation Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Controller Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Model Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> Model Class Initialized 
DEBUG - 2013-03-20 11:36:44 --> File loaded: application/views/view_home.php 
DEBUG - 2013-03-20 11:36:44 --> File loaded: application/views/template.php 
DEBUG - 2013-03-20 11:36:44 --> Final output sent to browser 
DEBUG - 2013-03-20 11:36:44 --> Total execution time: 0.0295

这是我的 .httaccess

重写引擎开启 RewriteBase /indocreweb/

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /indocreweb/index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /indocreweb/index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /indocreweb/index.php?/$1 [L] </IfModule>

#如果我们没有安装mod_rewrite,所有的404 #可以发送到index.php,一切正常。 #提交人:ElliotHaughin 错误文档 404 /index.php

从显示的日志中,我找不到任何线索是什么问题或导致它的原因。有人对此有想法吗? :-(

谢谢。

【问题讨论】:

  • 你的.htaccess文件好像有问题
  • 可以分享一下网址吗?
  • 检查您的错误日志。它将包含有关 500 的详细信息。
  • 检查 htaccess 并确保您的重写模块已启用。
  • @raheelshan 我添加了我的 htaccess 上面显示的内容。请看一下。你能告诉我问题是什么吗?谢谢

标签: codeigniter web-deployment


【解决方案1】:

从错误看来,这主要是因为 .htaccess 通常每个服务器都有 mod_rewrite 所以我不认为模块的存在是一个问题。

我认为您需要使用第一行:RewriteEngine On RewriteBase /indocreweb/ 尝试删除斜线,或者检查 url 是否正确 例如,如果您直接访问该网站,那么它应该是 RewriteBase 上的 RewriteEngine / 像 www.indocreweb.com

但如果它作为子文件夹或类似 www.indocreweb.com/indocreweb 的东西被访问 然后 RewriteBase 上的 RewriteEngine /indocreweb

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-03
    • 2018-02-22
    • 2012-05-01
    相关资源
    最近更新 更多