我決定證明這個silex框架。我將index.php文件,.htaccess和庫silex.phar放在我稱爲「prova」的同一目錄中。silex框架和.htaccess,獲取錯誤403訪問禁止
但是當我在我的瀏覽器中訪問URL「localhost /〜username/prova」時,我得到錯誤403 Access Forbidden。
我的錯誤是什麼?
下面我在我的應用程序中使用的代碼。
index.php文件
<?php
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->get('/hello/{name}', function ($name) use ($app) {
return 'Hello '.$app->escape($name);
});
$app->run();
而且.htaccess文件
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [QSA,L]
</IfModule>
什麼是index.php的_full_路徑?在機器上,不通過瀏覽器。 – Maerlyn 2012-01-04 09:45:13
我的index.php的完整路徑是'/ Users/username/Sites/prova' – davideagostini 2012-01-04 11:30:46
檢查你的apache錯誤日誌。通常在'/ var/log/apache2/error.log'中。 – igorw 2012-01-04 11:58:33