【发布时间】:2020-08-10 12:29:25
【问题描述】:
我正在尝试在我的 Laravel 7 应用程序中使用 Livewire 1.013。我刚刚在我的包中安装了 livewire。我正在使用 xampp apache 服务器。所以,我的项目 URL 就像 http://localhost/Projects/testproject/public 。
当我检查包含@livewireStyles 和@livewireScripts 的页面时,我收到net::ERR_ABORTED 404 (Not Found) 错误。我做了php artisan vendor:publish --tag=livewire:config 并在composer.json 文件中添加了@php artisan vendor:publish --force --tag=livewire:assets --ansi。我执行了composer dump-autoload。错误仍然存在。谁能帮我解决这个问题?
如果我使用http://127.0.0.1:8000/ 的 URL 执行 PHP artisan ser 而不是自定义项目 URL,它对我来说很好。但是,在我的情况下,我有不同的项目,我必须使用 xampp apcahe。
你能帮我解决这个问题吗?
提前致谢! 手动
【问题讨论】:
-
听起来您在 Apache 中的项目根目录路径不正确。您的网址中不应包含
public。 -
@DigitalDrifter:laravel 中的其他模块工作正常......例如我的登录路径是localhost/Projects/testproject/public/login.. 它显示登录页面......只有 livewire 有问题......我使用了公共文件夹,因为在apache中,我们必须点击项目公用文件夹才能进入主页