【问题标题】:Codeigniter: 500: Internal ErrorCodeigniter:500:内部错误
【发布时间】:2017-04-01 19:59:37
【问题描述】:

您好,我正在使用 Codeigniter,它在我的环境中运行良好。但是当我上传它时,它说 500: Internal Error

这是我的 .htaccess

# Customized error messages.

ErrorDocument 404 /index.php


# Set the default handler.

DirectoryIndex index.php


# Various rewrite rules.

<IfModule mod_rewrite.c>

  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-f

  RewriteCond %{REQUEST_FILENAME} !-d

  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

</IfModule>

[2016 年 11 月 17 日星期四 21:33:56] [错误] [客户端 120.29.125.182] Application.cpp:313 中的 SoftException:文件“/home2/choco/public_html/speedgaragedoor.com/speedgaragedoor/index.php”可按组写,referer:http://speedgaragedoor.com/

这是网站http://speedgaragedoor.com/speedgaragedoor/

【问题讨论】:

  • HTTP 500 是一般错误消息。当您看到它时,您的第一步应该始终是检查您的日志。它们应包含更具体的消息,以揭示问题的原因。
  • 只是一个小问题:您是否打算将您的 CI 应用程序安装在 speedgaragedoor 文件夹下?您的文档根目录中没有 index.xxx,因此我们都可以看到您的文档根目录。
  • 尝试重命名您的 .htaccess 文件以暂时将其从图片中移除,看看是否可以使用 speedgaragedoor.com/speedgaragedoor/index.php... 目前它不起作用...还有关于权限的说明。您可以将 index.php 设置为 644 吗? Hostgator 可能对这些很挑剔。
  • 您是否点击了您登陆的 hostgator 页面上的“我如何修复它”链接?
  • 我将权限更改为 644 但仍然是 500:内部错误。但是当我删除 index.php 时。没关系

标签: php .htaccess codeigniter


【解决方案1】:

你应该在 apache 上活跃 mod_rewrite

sudo a2enmod rewrite

那你应该重启 apache

sudo systemctl restart apache2

如果此操作无法解决您的问题,请检查 codeigniter 配置 转到 application->config 文件夹并检查配置文件 替换此代码

$config['base_url'] = 'http://localhost/xxx';

$config['base_url'] = '';

$config['index_page'] = 'index.php';

$config['index_page'] = '';

并使用此代码更改 .httacess 文件

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

【讨论】:

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