簡體   English   中英

本地設置上的 Laravel NotFoundHTTPException

[英]Laravel NotFoundHTTPException on local setup

我從另一個開發人員那里繼承了一個使用 Laravel 和 Cartalyst 構建的站點,該站點在生產服務器上正常工作,但是在我的本地安裝中,我在主頁上收到了 NotFoundHTTPException 並且沒有其他頁面工作。 本地設置是運行 Ubuntu 並使用 Apache 的筆記本電腦。

曾嘗試搜索論壇無濟於事。 該站點在生產服務器上完全正常工作,因此感覺它一定是我的配置問題,而不是實際的編碼問題。

當運行 php artisan route:list 時,會列出所有路由。 也嘗試清除路由緩存。

任何幫助或建議將不勝感激。 下面的相關文件。

.env 文件(相關部分)


    APP_KEY=xxxxxxxxxxxx
    APP_ENV=local
    APP_DEBUG=true
    APP_LOG_LEVEL=debug
    APP_URL=https://local.voicemag.uk

.htaccess


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

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

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

阿帕奇配置


    <VirtualHost *:443> ServerName local.voicemag.uk
    ServerAlias local.voicemag.uk

    ServerAdmin webmaster@localhost
    DocumentRoot /home/chris/Documents/Webdev/fresh/voicemagv3/public_html

    SSLEngine on
    SSLCertificateFile "/home/chris/Documents/Webdev/ssl/server.crt"
    SSLCertificateKeyFile "/home/chris/Documents/Webdev/ssl/server.key"

    <Directory /home/chris/Documents/Webdev/fresh/voicemagv3/public_html>
      Require all granted
      Allowoverride All
    </Directory>

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

如果您還需要什么,請告訴我。

NotFoundHttpException 只是因為您的網絡找不到與該名稱相關的任何路由嘗試通過創建虛擬主機或通過

php artisan serve 

http://localhost:8000上托管您的網站

解決方案是運行php artisan extension:autoload

非常感謝大家的幫助

暫無
暫無

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

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