为Codeigniter调整SimpleSAMLPHP

时间:2018-03-07 15:23:38

标签: php codeigniter simplesamlphp

我正在尝试将SimpleSAMLPHP用于我的Codeigniter应用程序。但是,当我尝试访问位于third_party / simplesaml / www / index.php中的管理控制台时,我在网址

时收到内部错误消息

https://url.com/simplesaml/module.php/core/frontpage_welcome.php

有没有办法正确访问索引页面?出于某种原因,它会一直重定向到此链接并且无法加载。请帮忙。

我的内部错误消息就是这个

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@website.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

日志中没有任何内容

这是我的控制器代码

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class SAMLConfig extends CI_Controller {

    public function __construct() {        
        parent::__construct();
        $this->verify_admin_session();

    }

    public function index()
    {   
        $data = array();
//        $this->load->library('simplesaml'); 
         include APPPATH.'third_party/simplesaml/www/index.php';
        ini_set('display_errors', 1);
        ini_set('display_startup_errors', 1);
        error_reporting(E_ALL);
//        $data['action'] = "SAMLConfig";

    }

}

更新:我怀疑我的htaccess文件可能与它有关。这是

#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L,QSA]
#RewriteCond %{HTTPS} off
#RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
#RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #THIS LINE ALLOWS BASIC AUTH FOR REST DO NOT DELETE#
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) App/$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_URI} !^/php-fpm/*
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ App/index.php/$1 [L]
</IfModule>

1 个答案:

答案 0 :(得分:0)

对于遇到此问题的其他人 - 我已通过执行以下操作设法让管理区域正常工作:

  1. 将您的www文件夹放在htdocs文件夹中(其余可能在third_party内的新文件夹中)
  2. 向您的htaccess添加重写规则,如RewriteRule ^simplesaml/(.*)$ www/$1 [L]
  3. 在www / _include.php中修改自动加载器路径到_autoload.php文件的绝对路径
  4. 我现在可以看到示例安装程序。我建议你不要把文件夹称为www,但是不同的东西不能公开访问。

    此外,在config.php中将admin.protectindexpage设置为true。