500 Internal Server Error What to do

This is on a site that has been working for over two months. ie w"ww.fdms.in

The problem which has come up " Internal Server Error … 500 Internal Server Error . "

I can login into my site ie "www.fdms.in/fdms/login.php and work,
however www.fdms.in/fdms/products.php or say www.fdms.in/fdms/index.php or any other location give the above error.

i tried with phpinfo() , same error!

Http 500 errors are usually caused by fatal php parse or run-time errors. You need to set php’s error_reporting to E_ALL and set display_errors to ON, like was stated in your previous thread, so that php will help you by reporting and displaying all the errors it detects.

This is on a shared server, where do I put the error_reporting to E_ALL and set display_errors to ON in which file? I

This error does not come up in an Html file! only some of the PHP files.
But the main question is why some of the PHP files are working ie all PHP files after login work properly

You should be able to create a ‘local’ php.ini, in your document root folder, with the settings in them. Your web host should have a FAQ section that covers if and how you can do this.

You can also put these settings into your code, though doing so won’t help with parse errors since your code never runs in this case to change the settings.

You can also post your code in the forum, less any database credentials, so that someone here can check it for parse errors or things it could be doing that is php version specific.

Got most working except one which gives this following error:
Warning : Undefined array key “option” in /home/fdmsin/public_html/fdms/head.php on line 40

<?php
session_start();
ob_start();
setlocale(LC_MONETARY, 'en_IN');
date_default_timezone_set('Asia/Kolkata');
$staffname = $_SESSION['staffname'];
$userlevel = $_SESSION['user_level'];
    if(!isset($userlevel)) {
    header('Location:login.html');
exit();
}
include "../fdms/config.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/comp.css" type="text/css" />
<script type="text/javascript" src="javascript.js"></script>
<script type="text/javascript">window.onload = date_time('date_time');</script>
</script>
</head>

<header class="section header">
<?php
$staffname=ucfirst($staffname);
echo "<li style='text-align: right; padding:5px;'>Logged In User: $staffname </li>";?>
<form action="" method="POST">
        <button style="width:auto; background:brown"   name="option" value="HOME" >Notice </button>
        <button style="width:auto; background:orange;" name="option" value="COMP">Complaints</button>
        <button style="width:auto; background:green;"  name="option" value="ATTE">Attendence</button>
        <button style="width:auto; background:blue; "  name="option" value="LOGOUT">Logout</button>
</form>
</header>
<div style='text-align: right; padding:5px; color:whitesmoke; 'id="date_time"></div>
<?php
$option=$_POST['option'];
if($option==='HOME')   {header("Location:notice.php");}
if($option==='COMP')   {header("Location:complaint.php");}
if($option==='ATTE')   {header("Location:attendence.php");}
if($option==='LOGOUT') {header("Location:logout.php");}
?>

Did you look at the line where the error is occurring at and attempt to determine why it is occurring? Did you notice that it is occurring before the form was submitted and not after?

yes I noticed that but am unable to rectify it, i

Sponsor our Newsletter | Privacy Policy | Terms of Service