[英]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.