Ajax error with server response HTTP ERROR 500
Ajax error with server response HTTP ERROR 500
I run into this problem:
DataTables warning: table id=publicationTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7
And this returns in the console:
POST http://sandbox.mettacontabilidade.com.br/lib/publicationProcessing.php 500 (Internal Server Error)
Followed tech notes advices howerever was empty Apache Log.
Can you help me? You can see the error reproduced here http://sandbox.mettacontabilidade.com.br/listPublication.php
This question has an accepted answers - jump to answer
Answers
The 500 error is coming from your server. Not sure what you are using for your server side application but typically when I receive a 500 error its due to an issue with my sql query syntax or incorrect field names.
What are you using for your server side code. Maybe you can post it for review.
Kevin
Of course @kthorngren, here is my server side from publicationProcessing:
Just to clarify, there were no errors on localhost.
This is just a comment to clarify that what is happening is that the file publicationProcessing.php is being blocked. And I need it to return the data in my table
@allan and @kthorngren.
The problem being reported is HTTP ERROR 500. My log error only have this related to today:
The browser console shows errors in listPublications.php.
Also you are probably looking at the wrong error log. A 500 will have been logged somewhere.
You should find out what your SQL query looks like. Try enabling the Editor debug mode.
In the link I gave @tangerine?
Yes.
Didn't found one publications. The referer in the console is: https://www.sandbox.mettacontabilidade.com.br/listPublication.php.
Isn't here correct @tangerine ?
Here is a debug I did now @tangerine (cc @kthorngren ) https://debug.datatables.net/akenas.
In advance I see that is a problem related with jQuery (I think):
My mistake, I meant "listPublication.php".
Okay @tangerine. And about the errorLog:
You can see by yourself that is empty.
I'm not familiar with the PHP libraries but if I remember correctly Allan has had people put
->debug( true )
immediately before->process(...)
to see the JSON response from the server and the SQL query.I would manually execute the SQL query.
Kevin
Yes, the
->debug()
method is useful when there is an SQL error - but this appears to be a bit more fundamental than that so it won't give anything helpful in this case I'm afraid.A 500 error indicates that there was an error executing the PHP script. That could be anything from it being PHP 5.3 or earlier to there being a syntax or configuration error.
You would need to check the server's error log. The log entry above appears to be an access log. The error log should be somewhere like
/var/log/apache2/error_log
, although its exact location will depend very much upon your server's configuration.Allan
I solved the first problem @allan, using your advice. This error_log was very hard to find, but after hours looking in folders I managed to find and the error was related to the casing (the web server is very case sensitive), in localhost:
Datatables.php was found
But in the web server I had to find rename publicationProcessing to look for:
DataTables.php