yii2服务器无法加载文件夹,用Yii2做的项目在部署到云服务器后访问无反应,也没有任何数据响应...

输入地址后一直在等待响应

经过检查,代码在跑到\vendor\yiisoft\yii2\base\View.php

public function renderFile($viewFile, $params = [], $context = null)

{

$viewFile = Yii::getAlias($viewFile);

if ($this->theme !== null) {

$viewFile = $this->theme->applyTo($viewFile);

}

if (is_file($viewFile)) {

$viewFile = FileHelper::localize($viewFile);

} else {

throw new ViewNotFoundException("The view file does not exist: $viewFile");

}

$oldContext = $this->context;

if ($context !== null) {

$this->context = $context;

}

$output = '';

$this->_viewFiles[] = $viewFile;

if ($this->beforeRender($viewFile, $params)) {

Yii::trace("Rendering view file: $viewFile", __METHOD__);

$ext = pathinfo($viewFile, PATHINFO_EXTENSION);

if (isset($this->renderers[$ext])) {

if (is_array($this->renderers[$ext]) || is_string($this->renderers[$ext])) {

$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]);

}

/* @var $renderer ViewRenderer */

$renderer = $this->renderers[$ext];

$output = $renderer->render($this, $viewFile, $params);

} else {

$output = $this->renderPhpFile($viewFile, $params);

}

$this->afterRender($viewFile, $params, $output);

}

array_pop($this->_viewFiles);

$this->context = $oldContext;

return $output;

}

在$output = $this->renderPhpFile($viewFile, $params)那行卡住了

从这个方法`public function renderPhpFile($_file_, $params = [])

{

ob_start();

ob_implicit_flush(false);

extract($_params_, EXTR_OVERWRITE);

require($_file_);

return ob_get_clean();

}`

来看,应该是生成变量然后读取视图文件再输出,但我水平实在不够,不明白为何会卡住而不报错

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值