-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update to 1.6.12 breaks admin #2627
Comments
Are you setting |
Actually think i found the bug, please try this for <?php
/**
* @package Grav\Core
*
* @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
if (PHP_SAPI !== 'cli-server') {
die('This script cannot be run from browser. Run it from a CLI.');
}
$_SERVER['PHP_CLI_ROUTER'] = true;
if (is_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME'])) {
return false;
}
$grav_index = 'index.php';
/* Check the GRAV_BASEDIR environment variable and use if set */
if ($grav_basedir = getenv('GRAV_BASEDIR') ?: '') {
$grav_index = ltrim($grav_basedir, '/') . DIRECTORY_SEPARATOR . $grav_index;
$grav_basedir = DIRECTORY_SEPARATOR . trim($grav_basedir, DIRECTORY_SEPARATOR);
define('GRAV_ROOT', str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . $grav_basedir);
}
$_SERVER = array_merge($_SERVER, $_ENV);
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . $grav_basedir .DIRECTORY_SEPARATOR . 'index.php';
$_SERVER['SCRIPT_NAME'] = $grav_basedir . DIRECTORY_SEPARATOR . 'index.php';
$_SERVER['PHP_SELF'] = $grav_basedir . DIRECTORY_SEPARATOR . 'index.php';
error_log(sprintf('%s:%d [%d]: %s', $_SERVER['REMOTE_ADDR'], $_SERVER['REMOTE_PORT'], http_response_code(), $_SERVER['REQUEST_URI']), 4);
require $grav_index; |
Yep, that does it, not even a warning in sight :) Thank you!
|
@rhukster I still seem to be getting this issue after trying your fix. Any advice? |
@MichaelJDavies Please upgrade Grav to 1.6.13. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On WSL (Windows 10-1903 / Ubuntu 18.04.3 LTS) after update to GRAV 1.6.12 & Admin 1.9.8 I get "Fetch Failed:" on all Admin pages and in the console:
PHP Warning: require(/index.php): failed to open stream: No such file or directory in /path-to-grav/system/router.php on line 38
PHP Fatal error: require(): Failed opening required '/index.php' (include_path='.:/usr/share/php') in /path-to-grav/system/router.php on line 38
All works fine when I revert the changes to system/router.php, so it should be related to the new GRAV_BASEDIR system variable.
The text was updated successfully, but these errors were encountered: