나는 기존의 라 라벨 프로젝트가 있습니다. Windows 10 컴퓨터에서 실행 중입니다.앞으로 및 뒤로 슬래시 php
<?php
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = urldecode($uri);
$paths = require __DIR__.'/bootstrap/paths.php';
$requested = $paths['public'].$uri;
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' and file_exists($requested))
{
return false;
}
require_once $paths['public'].'/index.php';
?>
지금 문제가 __DIR__ 함께 다음과 같이 나는 다음과 같은 명령을
cd c:/xampp/htdocs/demo/ (A file called index.php is there inside demo folder)
php -S localhost:8000
index.php 파일을 실행하고하는 내용을 가지고있다. 경로를 인쇄하려고 할 때 앞뒤 슬래시가 혼합되어 있습니다. (요청 $) 예를 들어
C:\xampp\htdocs\demo\bootstrap/../public/
이 응용 프로그램의 실행을하자 내부 서버 오류가 발생하지 않는 프로젝트 (500)
많은 장소 __DIR__ 있습니다. 나는 한 곳에서 그것을 대체 할 수 없다.
아무도 도와 줄 수 있습니다.
Windows에서, 앞뒤 슬래시 혼합, 내 경험에 잘 작동합니다. 그것은 서버가 폴더를 입력 할 수있는 권한이 없을 수도 있습니다, 당신은 PHP 내장 서버 대신 아파치를 사용해 볼 수도 있습니다 – SmartCoder