2015-12-23 39 views
0

我帶着larave 5.1框架創建了自己的簡單項目。它在localhost中工作正常。如何在現場服務器上託管Laravel 5.1

我嘗試在免費託管活動服務器上移動(byethost.com - php版本> 5.4)。但我不知道如何在活動服務器中進行部署。

我經歷了一些文檔。以便我將所有文件移至public_html文件夾。然後將public_html /公共文件轉移到public_html文件夾中。在index.php中更改文件路徑。

即使我沒有看到任何正確的輸出。我是否需要任何其他配置?請幫幫我。

注意:我遇到了服務器500錯誤。這個錯誤的確切原因是什麼?

+2

[Laravel 5.1 host on host]可能重複(http://stackoverflow.com/questions/31113042/laravel-5-1-upload-on-host) –

回答

1

首先,您必須將根目錄中的所有文件(public目錄除外)上傳。然後將public目錄中的所有內容上傳到服務器public_html目錄中。然後編輯server.php文件,並替換所有publicpublic_html這樣

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 
); 

// 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 !== '/' && file_exists(__DIR__.'/public_html'.$uri)) { 
    return false; 
} 

require_once __DIR__.'/public_html/index.php'; 

記住laravel與PHP版本5.5.9運行>。如果你的服務器沒有滿足要求,它可能無法正常工作。