Edit: This issue was fixed by turning "output_buffering" to "on" in php.ini on vps server. Thank you.
After moving from shared godaddy server to managed VPS on godaddy, the PHP header redirects stopped working on the website.
if(isset($_SESSION['user_id'])){
@header("Location: dashboard.php");
}
Any of these header redirects do not work any more.
Do you know which modules need to be installed or settings that need to be changed for this to work again? It was working fine on the shared server, and also it was tested on another server and worked fine. Just this VPS did not work. It is using WHM cpanel with easyapache 3.
Thank you.
"Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP" http://php.net/manual/en/function.header.php
Maybe there's a problem with session, not header function. I'd suggest you to try sending header without any condition, and if it works, make sure that session.save_path is writable.
This issue was fixed by turning "output_buffering" to "on" in php.ini on vps server. Thank you.