Search code examples
phpajaxjsoninternal

ajax call returns 500 internal error


i have some $.getJSON() calls which work locally just fine but when i upload the script on live server it just throws 500 internal error , i also have some other ajax calls(not json) where some work and some not..

i tried to go directly to the file where i call the $.getJSON() but i just wont get anything.. not a simple error

ex.

        $.getJSON("file.php",
        function(data){
            console.log(data);
        });

throws 500 internal error..

but this:

$.ajax({
    type: "POST",
    url: "file2.php",
    data: {
        val: '1'
    },
    success: function(data){
        console.log(data);
    }
});

seems to work

inside the file.php i check if its an ajax request and then store some values in an array and then echo it as json_encode($array);

all these work on local machine but not on live server

EDIT: solution was just to remove and add again the files on the server.


Solution

  • EDIT: solution was just to remove and add again the files on the server.