Codeigniter 4在本地工作正常,但在线生产服务器给出错误:CodeIgniter \ View \ Exceptions \ ViewException

问题描述

在服务器上上传时

/app
/public_html
/vendor
/writable

并使用https://server.com/home看到欢迎页面,但是当我使用https://server.com/pages时出现错误'CodeIgniter \ View \ Exceptions \ ViewException 无效的文件:pages / home.php'第21行的

 public static function forEnabledZlibOutputCompression()
15   {
16   return new static(lang('Core.enabledZlibOutputCompression'));
17   }
18 
19  public static function forInvalidFile(string $path)
20   {
21  return new static(lang('Core.invalidFile',[$path]));
22   }
23 
24  public static function forCopyError(string $path)
25     {
26         return new static(lang('Core.copyError',[$path]));
27     }
28 

解决方法

return view('users/signin',$data);

<?= $this->extend('layouts/signin') ?>

这是 Slash 问题引起的,我以前遇到过同样的问题,现在一切都很好

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...