0

I have just migrated my site from PHP 5.3 to PHP 5.2 and Cakephp $this->redirect() function has stopped working.

I tried many things but only JavaScript redirect works.

--Upgraded server PHP from 5.2 to 5.3 (not worked)

I have faced this(PHP header) issue many times before. Please suggest a way to solve this.

Mifeet
  • 12,949
  • 5
  • 60
  • 108
Pankaj S
  • 63
  • 6
  • 2
    some further infos that could be helpful would be the version of Cake and also a snippet of the non working code – harpax Jun 07 '13 at 12:34
  • Do you have any error messages ? Is your Cakephp writing errors in log file ? – furas Jun 07 '13 at 12:34
  • What's the error you're getting ? Post the code you're using. We need more details since we're not using magical crystal balls here. – Nasreddine Jun 07 '13 at 12:35
  • Did you change 5.3->5.2 or the other way around? Your post is confusing about it. – Mifeet Jun 07 '13 at 12:46
  • And if it's a "headers already sent" issue, look [here](http://stackoverflow.com/questions/8028957/headers-already-sent-by-php), this question has been asked many times already. – Mifeet Jun 07 '13 at 12:47
  • no I changes 5.2->5.3 – Pankaj S Jun 07 '13 at 13:11

1 Answers1

2

In your controller where you want to redirect,check is there any blank space exists.I modified my controller and it was working fine for me.

ABorty
  • 2,512
  • 1
  • 13
  • 16
  • 2
    `redirect` is declared in `Controller`, so you cannot use it in the model – harpax Jun 07 '13 at 12:33
  • yea, it is defined in controller. And i have many controllers. I have checked them for the spaces but it is not working. – Pankaj S Jun 07 '13 at 12:34