user606521
user606521

Reputation: 15464

cakephp redirect doesn't work on server

On my PC with WAMP server and php 5.3.9 everything works fine.

When I upload it to server with php 5.2.1.7 all redirects stop working - when the ->redirect(..) is executed script stops working - it acts like there was die; instead of redirect and nothing is printed and redirect doesnt work.

These are redirects I am using:

$this->redirect( array('controller' => 'users', 'action' => 'login') );
$this->redirect( $this->referer() ) 

Both (in fact all...) stopped working after upload to server...

------ edit

I managed to show E_ALL errors and for example if I write $omg->lol() before redirect the error is reported as

Notice (8): Undefined variable: omg [APP/Controller/LanguagesController.php, line 31] Fatal error: Call to a member function lol() on a non-object in ...

But still no error message for redirect...

Upvotes: 4

Views: 1960

Answers (1)

user606521
user606521

Reputation: 15464

I managed to fix it! The problem was that few php files had some tabs or whitespaces before <?php tags and after ?> tags - when I deleted them everything works fine - damn PHP is real bitch!!!

Upvotes: 3

Related Questions