Php codeigniter重定向发生在本地环境,但不是生产现场
我正在使用Ion_auth和codeigniter。我有以下资料:Php codeigniter重定向发生在本地环境,但不是生产现场,php,codeigniter,Php,Codeigniter,我正在使用Ion_auth和codeigniter。我有以下资料: if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data)) { //check to see if we are creating the user $this->s
if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data))
{
//check to see if we are creating the user
$this->session->set_flashdata('message', 'PLEASE CHECK EMAIL');
redirect("auth", 'refresh');
在我的wamp开发环境中,如果预期重定向到“auth”控制器,这将很好地工作。但我只是在远程网站上看到一个空白屏幕
下一步该怎么办
增编:
我已将错误报告更改为生产站点上的最高级别,现在得到:
严重性:警告
Message: Cannot modify header information - headers already sent by (output started at /mydomain.com/application/config/production/database.php:1)
Filename: libraries/Session.php
Line Number: 675
Message: Cannot modify header information - headers already sent by (output started at mydomain.com/application/config/production/database.php:1)
Filename: helpers/url_helper.php
Line Number: 540
严重性:警告
Message: Cannot modify header information - headers already sent by (output started at /mydomain.com/application/config/production/database.php:1)
Filename: libraries/Session.php
Line Number: 675
Message: Cannot modify header information - headers already sent by (output started at mydomain.com/application/config/production/database.php:1)
Filename: helpers/url_helper.php
Line Number: 540
消息:无法修改标题信息-标题已由发送(输出从/mydomain.com/application/config/production/database.php:1开始)
这通常是由于会话启动前包含的文件输出的空白造成的
确保
应用程序/config/production/database.php
文件中没有多余的空格(包括新行、空格等)。该文件中的第一个字符应该完全是
标记,以确保您不会遇到问题,例如,?>\n
…您熟悉Chrome的开发工具吗?如果您使用的是Chrome,请按F12。页面上有错误吗?请求是什么样子的?也许在auth.php控制器的顶部放一个“die('works find至此');”,看看你是否成功了。大卫,我把die('works find至此');在auth index函数中,文本是本地打印的,但不是在线打印的,这表明文本不存在。因此,上面if语句中的2行中至少有1行有问题,我也不认为它是循环的,如果这就是你的意思,因为auth是一个不同于基本控制器的控制器。你不想重定向(“auth/login”,“refresh”)???这就是我重定向的方式。我今天就到此为止……如果你仍然没有运气,你可能必须尝试手动转到该路线(在地址栏中手动键入)。如果通过输入URL手动转到控制器有效,那么我很困惑为什么上面的语句不起作用。文件开头只有一个空格字符。它现在起作用了。