Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax getting 500 internal error

Tags:

ajax

php

So, I have a ajax setup with two contents from two separate files as shown below.

Files:

my_site_id_one.php:

<div class="id_one_content">
     <?php echo do_shortcode('[shortcode_one]'); ?>
</div>

my_site_id_two.php:

<div class="id_two_content">
     <?php echo do_shortcode('[shortcode_two]'); ?>
</div>

Problem

So, the ajax function itself works fine. For example, when I call for the "my_site_id_two.php", then it calls the "[shortcode_two]" and works just fine (meaning, it shows the [shortcode_two]content.

However with the [shortcode_one], I am getting an error as following (from the console).

 Object {readyState: 4, responseText: "<div class="royal_selection_heading   royal_heading_…rapper featured-item-list">
↵            
↵
↵    ", status: 500, statusText: "Internal Server Error"}

Any advice to why it might be causing this? Or is it a more complicated problem than I think?

Thanks.

like image 287
HEYHEY Avatar asked Jun 09 '26 23:06

HEYHEY


1 Answers

This is entirely a server side issue, not possibly related to your AJAX request.

An error of 5xx means the request was sent successfully by the client, received successfully by the server, but while performing the associated work on the server something bad happened that triggered a fatal error, resulting in the termination of the PHP script.

5xx Server Error

like image 139
John Weisz Avatar answered Jun 12 '26 11:06

John Weisz