我的專案的根結構如下:

index.php

突出顯示的行是自己的拋出錯誤:

我不知道如何解決這個問題。顯然自動加載不起作用,但不確定如何修復,因為路徑是正確的。我還洗掉了供應商檔案夾并運行:composer install, composer update and then composer dump-autoload.
還要做什么。我的本地加載正常。只有現場直播。我也跑了這個:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan config:cache
php artisan route:cache
php artisan optimize
uj5u.com熱心網友回復:
轉到 laravel/public 目錄并將所有檔案夾復制到 public 檔案夾之外。然后更改 index.php 檔案中的路徑。如果你的專案在像 public_html/laravel/ 這樣的目錄中提供服務,那么這
需要DIR .'/../laravel/vendor/autoload.php';$app = require_once DIR .'/../laravel/bootstrap/app.php '; 如果你的專案在 public_html/ 然后需要DIR .'/vendor/autoload.php';$app = require_once DIR .'/bootstrap/app.php';
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/317449.html
上一篇:找不到視圖,但它已經存在
