Php 未能打开流:opencart ajax请求成功

Php 未能打开流:opencart ajax请求成功,php,json,opencart,Php,Json,Opencart,我在谷歌上搜索了一天,运气不好。有人能帮忙吗 我有一个AJAX请求,它在主页上加载了更多的类别。代码是 $json=array(); $template = new Template(); $template->data['categories'] = $this->data['categories']; $html = $template->fetch($this->config->get('config_template') . '/template/commo

我在谷歌上搜索了一天,运气不好。有人能帮忙吗

我有一个AJAX请求,它在主页上加载了更多的类别。代码是

$json=array();
$template = new Template();
$template->data['categories'] = $this->data['categories'];
$html = $template->fetch($this->config->get('config_template') . '/template/common/category_load.tpl');
$json['success'] = $html;
$json['output'] = $this->render();
$this->response->setOutput(json_encode($json));
当我检查函数时,它会给出正确的输出。但是,当试图通过AJAX加载时,会出现这样的错误

未能在第82行的/var/www/html/boomrc/system/engine/controller.php中打开流:成功


我做错什么了吗?我是OpenCart新手。

请使用浏览器调试控制台。 确保您没有对ajax执行跨域请求。 由于存在一些安全限制,所以不能跨域请求ajax

也许在这里发布你的controlle.php(或它的简化代码)


试试这个..

给我们看看ajax代码哦!很抱歉,我忘了添加数据类型json。很抱歉,如果您需要答案,您必须从controller.php提供第82行(以及更多的上下行),因为这就是错误的来源。没有这些代码,就不可能看到发生了什么。
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/category_load.tpl')) {
                    $this->template = $this->config->get('config_template') . '/template/common/category_load.tpl';
            } 


            $json['content'] = str_replace("\r\n", "", $this->render());
            echo json_encode($jdata);