2015-11-29 53 views
0

這是我第一次上傳並共享Laravel 5項目到服務器。「致命錯誤:要求():失敗打開需要...」上傳laravel 5項目到服務器後出錯

我在網上學習了很多資源和主題來解決這個問題,但是我不能。

這是我的服務器上的文件夾和文件的結構:

enter image description here

這是我在的public_html/index.php的文件的變化:

require __DIR__.'/../tc/bootstrap/autoload.php'; 

$app = require_once __DIR__.'/../tc/bootstrap/app.php'; 

根據其他研究的主題我認爲所有的事情都可以。但是當打開主域名時,我遇到以下錯誤:

Warning: require(/home/tc/domains/tc-iran.ir/public_html/../tc/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/tc/domains/tc-iran.ir/public_html/index.php on line 22 

Warning: require(/home/tc/domains/tc-iran.ir/public_html/../tc/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/tc/domains/tc-iran.ir/public_html/index.php on line 22 

Fatal error: require(): Failed opening required '/home/tc/domains/tc-iran.ir/public_html/../tc/bootstrap/autoload.php' (include_path='.:/usr/local/lib/php') in /home/tc/domains/tc-iran.ir/public_html/index.php on line 22 

問題和解決方案是什麼?

+1

你有沒有正確設置上傳的文件的權限和所有權? – Alex

+1

'public_html'有775個,包含所有laravel文件的'tc'有755個權限。 –

回答

1

我不知道爲什麼我解決了這個問題。

我只是將tc(主laravel內容項目文件)移動到domains下一個public_html文件夾存在那裏。

這是服務器上的新文件夾結構:

enter image description here

相關問題