php中修改config.php,如何修改config文件夹中的routes.php后修正这些php错误?

A PHP Error was encountered Severity: Warning

消息:不能修改标题信息 - 已经发送的标题

(输出开始于

/home/jshultz/public_html/application/cache/routes.php:3)

文件名:core / Security.php

行号:188

遇到PHP错误严重性:警告

消息:不能修改标题信息 - 已经发送的标题

(输出开始于

/home/jshultz/public_html/application/cache/routes.php:3)

文件名:库/ Session.php

行号:672

BLOCKQUOTE>

我想也许这是一个权限错误,但我不知道?我试着改变文件的权限,但没有改变任何东西。有任何想法吗?

编辑:

好的,所以应用程序/缓存文件夹中的routes.php需要打开

以下是在缓存文件夹中创建routes.php文件的CORRECTED代码:

public function save_routes()

{

// this simply returns all the pages from my database

$routes = $this->Pages_model->get_all($this->siteid);

// write out the PHP array to the file with help from the file helper

if ( !empty( $routes ) )

{

// for every page in the database, get the route using the recursive function - _get_route()

foreach( $routes->result_array() as $route )

{

$data[] = '$route["' . $this->_get_route($route['pageid']) . '"] = "' . "pages/index/{$route['pageid']}" . '";';

}

$output = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n";

$output .= implode("\n", $data);

$this->load->helper('file');

write_file(APPPATH . "cache/routes.php", $output);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值