I have been getting an "500 Internal Server Error" whenever I use header().
Here's a snippet of my emails with my host:
[host support to me]
Re: 500 Internal Server Error
Make sure that you are not using any .htaccess PHP directives and
that any files associated with your PHP scripts do not have group orworld write permissions.
[me to support]
OK. I figured out what the problem is:
Note: no .htaccess PHP directives here folks...
Anytime I try to use a header() function, I get the error. When I take it out, no error. It is REALLY necessary to be able to write
headers....redirection, authentication, and the list goes on. Two violators below....
- if($group <= 2) {
header("Location:http://www.foo.com/admin.php");
} else { etc...... - if (!isset($PHP_AUTH_USER)) {
//IF EMPTY SEND HEADER TO BRING UP DIALOG BOX
header("WWW-Authenticate: Basic Realm=\"foo\",stale=FALSE");
header("HTTP/1.0 401 Unauthorized");
echo "You are not authorized to enter this section of the
site!\n";
exit;
} else { etc....
Both pretty basic - and necessary
[host to me]
Are you suggesting that we need to recompile PHP to get this working or is this something that can be fixed by modifying the master
php.ini files? Please advise.
END>>>>>>>>>>>>>>>>>>>>>>
I don't know enough about PHP.ini to answer them, and they don't seem to either!
Any Suggestions?