2016-09-28 40 views
2

一切順利,我已經運行laravel new/etc/apache2/sites-available/laravel.example.com.confLaravel不加載

<VirtualHost *:80> 

     ServerName laravel.example.com 
     DocumentRoot /var/www/blog/public 

     <Directory /> 
       Options FollowSymLinks 
       AllowOverride None 
     </Directory> 
     <Directory /var/www/blog> 
       AllowOverride All 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 
     LogLevel warn 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

然後

a2ensite laravel.example.com 

並重裝Apache和添加"127.0.0.1 laravel.example.com" >> /etc/hosts

現在,當我去http://laravel.example.com打印index.php的源代碼

+0

也許你的php沒有啓用。 – follio

+0

看起來你在你的配置中有一個php錯誤,你的php版本是什麼? – Derek

+0

結帳:http://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page – Derek

回答

0

白頁可能是由許多問題引起的。嘗試chmod -R 0777存儲文件夾,也許Laravel沒有權限在該文件夾中寫入,甚至無法顯示錯誤頁面。或者你可以檢查你的Apache錯誤日誌

0

你是否已經在虛擬主機文件中定義了「DirectoryIndex」?它似乎沒有定義。