500内部服务器错误php - ajax

I received an error (500 Internal Server Error) when I wanted to test my files on a server. Everything just worked fine with mamp (local) and I received no errors. Here's the code with the error.

<?php
    include_once('../classes/places.class.php');
try
{
    $oPlace = new Places();
    $oPlace->Street = $_POST['place'];
    $oPlace->HouseNumber = $_POST['number'];
    $oPlace->Name = $_POST['Name'];
    if($oPlace->placeAvailable())
    {
        $feedback['status'] = "success";
        $feedback['available'] = "yes";
        $feedback["message"] = "Go ahead, street is available";
    }   
    else
    {
        $feedback['status'] = "success";
        $feedback['available'] = "no";
        $feedback["message"] ="De zaak " . "'" . $_POST['name'] . "'". " is reeds op dit adres gevestigd." ;;
    }
}
catch(exception $e)
{
    $feedback['status'] = "error";
    $feedback["message"] =$e->getMessage();

}
header('Content-type: application/json');
echo json_encode($feedback);
?>
$feedback["message"] ="De zaak " . "'" . $_POST['name'] . "'". " is reeds op dit adres gevestigd." ;;

should be more like

$feedback["message"] ="De zaak " . "'" . $_POST['name'] . "'". " is reeds op dit adres gevestigd." ;

adding one too many semi colons can sometimes throw an error

What version of PHP is it?

If prior to 5.2 you need to install the JSON PECL package.

If 5.20 or later you have to check that PHP was compiled without the --disable-json option.

<?php
include_once('../classes/places.class.php');
/* This if for debugging */
foreach ($_GET as $k => $v) $_POST[$k] = $v;
// Access in your browser: pathToFilePHPCalled.php?place=SomePlace&number=14&Name=MyName
$feedback['data'] = $_POST;
/* This if for debugging */

$feedback = array();
try
{
    $oPlace = new Places();
    $oPlace->Street = $_POST['place'];
    $oPlace->HouseNumber = $_POST['number'];
    $oPlace->Name = $_POST['Name']; // Make sure this is $_POST['Name'] and not $_POST['name'] this might be your error
    if($oPlace->placeAvailable())
    {
        $feedback['status'] = "success";
        $feedback['available'] = "yes";
        $feedback["message"] = "Go ahead, street is available";
    }   
    else
    {
        $feedback['status'] = "success";
        $feedback['available'] = "no";
        $feedback["message"] ="De zaak " . "'" . $_POST['name'] . "'". " is reeds op dit adres gevestigd." ;
    }
}
catch(Exception $e)
{
    $feedback['status'] = "error";
    $feedback["message"] =$e->getMessage();

}
header('Content-type: application/json');
echo json_encode($feedback);
?>