Altorouter
을 기본 PHP 응용 프로그램 (프레임 워크 없음)에서 사용하고 있지만 어떻게 든 작동하지 않습니다.Altorouter가 경로를 실행할 수 없습니다
그것은 가 완료를 인쇄합니다
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
require_once __DIR__ . '/vendor/autoload.php';
$router = new AltoRouter();
$router->map('GET', '/', function() {
include __DIR__ . 'home.php';
});
print "Done";
의 index.php와 PHP 로그에 오류 : 아래 사항입니다.
htaccess로
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
나는`http://localhost/home/myapp/
아마'이어야한다 __DIR__ 포함 . '/home.php'; ' – Phil
@Phil은 여전히 작동하지 않았습니다. – Volatil3
@ Phil - yep. 나는'require '를 사용하는 것으로까지까지 나아갈 것이다. 포함 된 파일에서 배열처럼 돌아 오는 경우 내가 찾은 유일한 진정한 이점이 있습니다. 그렇지 않으면 require가 실패하고 빠진 슬래시를 알려줍니다. __DIR__은 경로에 엔딩 슬래시를 추가하지 않습니다. – ArtisticPhoenix