codeigniter - ini_set() : Headers already sent. 此时无法在 codeigniter 中更改 session 模块的 ini 设置

标签 codeigniter header ini-set

我正在使用 CI 3.1.10。在 index.php 文件中我使用开发环境。

我的 Controller

<?php
class Test extends CI_Controller {
public function index(){
    echo CI_VERSION; 
 }
}

?>



当我尝试访问测试类时,它会向我显示此错误

这是向我展示警告的图像。

Screenshot of the error is attached

最佳答案

ob_start();
在根目录下 index.php 的第一行。这有效。

关于codeigniter - ini_set() : Headers already sent. 此时无法在 codeigniter 中更改 session 模块的 ini 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60256450/

相关文章:

PHP display_errors = 0 不被尊重

php - 使用 ini_set() 的 PSR-1 兼容替代方案是什么?

mysql - Codeigniter 查询我的特定专栏中的订单

windows - 在 IIS 上删除 Codeigniter 的 index.php?

C++ 异步任务。包含 "Future"麻烦

PHP 缓冲区为什么\r\n

php - ini_set ('post_max_size'、 '200M')在 php 5.4 中不起作用

php - 代码点火器 : pass data to a view included in a view

php - Codeigniter-管理员为特定用户添加数据,用户在登录时看到管理员输入的数据

html - 将导航栏和背景颜色添加到 CSS 后,H1 无法运行