【问题标题】:My View's doesn't exist after moving it to hosting site将其移至托管站点后,我的视图不存在
【发布时间】:2025-11-29 02:20:02
【问题描述】:

将其移至生产服务器后,我的视图开始不存在,这很奇怪。

这是我的堆栈跟踪

Unhandled Exception
Message:
View [employer.jds] doesn't exist.
Location:
/var/www/vhosts/aquariusmc.com/httpdocs/laravel/view.php on line 170
Stack Trace:
#0 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/view.php(107): Laravel\View->path('employer.jds')
#1 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/view.php(218): Laravel\View->__construct('employer.jds', Array)
#2 /var/www/vhosts/aquariusmc.com/httpdocs/application/controllers/employer/main.php(18): Laravel\View::make('employer.jds', Array)
#3 [internal function]: Employer_Main_Controller->get_jobDispatchSheet()
#4 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/routing/controller.php(325): call_user_func_array(Array, Array)
#5 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/routing/controller.php(285): Laravel\Routing\Controller->response('jobdispatchshee...', Array)
#6 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/routing/controller.php(165): Laravel\Routing\Controller->execute('jobdispatchshee...', Array)
#7 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/routing/route.php(153): Laravel\Routing\Controller::call('employer.main@j...', Array)
#8 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/routing/route.php(124): Laravel\Routing\Route->response()
#9 /var/www/vhosts/aquariusmc.com/httpdocs/laravel/laravel.php(167): Laravel\Routing\Route->call()
#10 /var/www/vhosts/aquariusmc.com/httpdocs/public/index.php(34): require('/var/www/vhosts...')
#11 {main}

【问题讨论】:

  • 尝试使用realpath('employer.jds'),然后错误消息应该会显示完整路径,这样更容易排除故障。
  • 你确定它们被上传了吗?
  • m8r-1jmw5r:我会试试的
  • Oddman:嗨,我将整个文件夹上传到我的服务器。所以我确定它们都已上传

标签: php laravel


【解决方案1】:

我通过在所有视图的文件名上使用小写来解决它。我认为 Plesk(CentOS) 与 camelCase 文件名有关。不过还是谢谢!

【讨论】:

  • 这是在windows上开发时很常见的错误,但使用的是linux生产机器。只需在文件名中避免全部大写即可。 Linux 区分大小写,Windows 不区分(在大多数情况下,尽管 NTFS 支持)
最近更新 更多