Header function

I have moved my site from my local host development server to a shared host. My learning curve as a newbie continues. I have lost all the error handling that my localhost was providing. Is there a way to turn that on? I presume the shared host has configuration files I can get to. I presume a standard apache configuration from my host, blue host com. My biggest issue is that my php codes are executing but the header function is not redirecting to the file of my choice. Is there something I need to turn on?

You should be able to create or edit a local php.ini, in your account’s document root folder, where you can set php settings. If this is not available, you can set php’s error related settings in your code. Any particular host may disable certain settings in a misguided attempt at making their hosting more secure.

On a live/public server, you would want to log all php errors (you can temporarily switch to displaying all php errors so that you get immediate feedback as to any problems…)

This is most likely because there’s output being sent to the browser before the header AND php’s output_buffering is turned on in the php.ini on your development system. The best course of action would be to turn off the output_buffering setting on your development system, so that any code you develop will be portable between different server setups, which you may not have the ability to change on hosting that you don’t manage yourself.

Thank you. I did have a couple echo functions I used for telling me where I was getting in my php file. I commented those out and I am still not getting my redirects. The code was running without error on my localhost which is what led me to believe it was a configuration issue.

Sponsor our Newsletter | Privacy Policy | Terms of Service