Hallo,
ich habe mir hier, https://hashgenerator.de/ den SHA-512 Code geholt.
Nun habe ich mir die app_dev.php vom Server bei Alfahosting runter geladen.
In der Datei app_dev.php finde ich viermal den Eintrag $accessKey.
Code:
<?php
/*
* This file is part of Contao.
*
* Copyright (c) 2005-2017 Leo Feyer
*
* @license LGPL-3.0+
*/
use Contao\ManagerBundle\ContaoManager\Plugin as ManagerBundlePlugin;
use Contao\ManagerBundle\HttpKernel\ContaoKernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpFoundation\Request;
/** @var Composer\Autoload\ClassLoader */
$loader = require __DIR__.'/../vendor/autoload.php';
/***********************************************************************************************/
/* ### READ FIRST ### */
/* Access to debug front controllers must only be allowed on localhost or with authentication. */
/* Use the "contao:install-web-dir" console command to set a password for the dev entry point. */
/***********************************************************************************************/
if (file_exists(__DIR__.'/../.env')) {
(new Dotenv())->load(__DIR__.'/../.env');
}
$accessKey = @getenv('APP_DEV_ACCESSKEY', true);
if (
isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || PHP_SAPI === 'cli-server')
) {
if (false === $accessKey) {
header('HTTP/1.0 403 Forbidden');
die(sprintf('You are not allowed to access this file. Check %s for more information.', basename(__FILE__)));
}
if (
!isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])
|| !password_verify($_SERVER['PHP_AUTH_USER'].':'.$_SERVER['PHP_AUTH_PW'], $accessKey)
) {
header('WWW-Authenticate: Basic realm="Contao debug"');
header('HTTP/1.0 401 Unauthorized');
die(sprintf('You are not allowed to access this file. Check %s for more information.', basename(__FILE__)));
}
}
unset($accessKey);
Debug::enable();
ManagerBundlePlugin::autoloadModules(__DIR__.'/../system/modules');
ContaoKernel::setProjectDir(dirname(__DIR__));
$kernel = new ContaoKernel('dev', true);
Request::enableHttpMethodParameterOverride();
// Handle the request
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Ich habe den generierten Code hier eingefügt, ich hoffe das ist richtig.
Code:
if (
!isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])
|| !password_verify($_SERVER['a79a45b3701d2d72ea0a40b7ceab19239e72c9893a74d23dfe8f9320e6a790aa'].':'.$_SERVER['eb6d8f5f70eef2641e2185953ba070dd037849da6970b8f2223dfd850f38aa69'], $accessKey)
)
Leider bekomme ich aber beim Aufruf bei Alfahosting über diesen Link http://contao4.of-white-avalanche.de/app_dev.php
diese Meldung, wo liegt der Fehler?
You are not allowed to access this file. Check app_dev.php for more information.
Lesezeichen