簡體   English   中英

index.php不會加載laravel和wamp

[英]index.php don't load with laravel and wamp

我是新手。 所以我有一個laravel應用程序的問題。 當我嘗試打開www.test.com/或www.test.com/index.php時,我可以訪問任何URL,如www.test.com/something,但瀏覽器會返回“此網頁不可用ERR_CONNECTION_RESET”

我正在使用Wamp Server 2.5

httpd-vhosts.conf文件

    <VirtualHost *:80>
      DocumentRoot "c:/wamp/www/test/public"
      ServerName test.com
    </VirtualHost>

的.htaccess

   <IfModule mod_rewrite.c>
   <IfModule mod_negotiation.c>
      Options -MultiViews
   </IfModule>

   RewriteEngine On


   # Redirect Trailing Slashes...
   RewriteRule ^(.*)/$ /$1 [L,R=301]

   # Handle Front Controller...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^ index.php [L]

   </IfModule>

在routes.php中獲得了這一行

Route::get('/', 'PagesController@index');

LoadModule rewrite_module modules / mod_rewrite.so未注釋。 當我插入類似

echo "test"; exit;

在index.php的最開始,它可以正常工作並顯示該消息。 訣竅是具有相同設置的另一個項目可以正常工作。 有任何想法嗎?

編輯:問題出在像{{-smthg-}}之類的BLADE注釋中。 通過替換普通的HTML注釋解決

您需要告訴計算機test.com域托管在服務器上,您可以通過將其添加到主機文件中來實現。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM