AJAX POST 500 INTERNAL SERVER ERROR

admin

Administrator
Staff member
I just finished creating infinite loop for my wordpress blog, It's working great on my local PC( WAMP), but when I put it online (nginx server) its showing
Code:
POST http://www.siteurl.com/infinite-loop.php 500 Internal Server Error

<strong>Infinite_loop.php</strong>

Code:
&lt;?php

$infinite_loop= $_POST['pcount']; ?&gt;

&lt;?php require_once("/wp-blog-header.php"); ?&gt;

  &lt;div class="x-container-fluid max width main"&gt;
    &lt;div class="offset cf"&gt;
      &lt;div class="&lt;?php x_main_content_class(); ?&gt;" role="main"&gt;
            &lt;?php
                    global $wpdb;
                    $args = array( 'posts_per_page' =&gt; 10, 'order' =&gt; 'DESC', 'offset'=&gt;$infinite_loop );    
                    $myposts = get_posts( $args );
                    foreach ( $myposts as $post ) : setup_postdata( $post ); ?&gt;
                    &lt;article id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;


                        &lt;div&gt;
                            &lt;div style="width:300px; float:left;"&gt; 
                                &lt;?php x_ethos_featured_index(); ?&gt; 
                            &lt;/div&gt;
                            &lt;div style="width:500px; float:right;"&gt;
                                &lt;?php /* print $args['offset']; */ ?&gt;
                                &lt;?php x_get_view( 'ethos', '_content', 'post-header' ); ?&gt;
                                &lt;?php x_get_view( 'global', '_content' ); ?&gt;
                                &lt;?php


                            &lt;/div&gt;
                         &lt;/div&gt;
                    &lt;/article&gt;
                    &lt;?php endforeach; 
                                wp_reset_postdata(); ?&gt;


&lt;/div&gt;      &lt;?php get_sidebar(); ?&gt;
&lt;/div&gt;&lt;/div&gt;

<strong>AJAX IN THEME HEADER</strong>

Code:
&lt;script&gt;
$(document).ready(function() {

var post_page_count = 10;
var height_scroll = 400;
    $(window).scroll(function() {

    if ($('body').height() &lt;= ($(window).height() + $(window).scrollTop())){
        post_page_count = post_page_count+10;

        $.ajax({
            type: "POST",
            async: false,
            url: "theme/infinite_loop.php",
            data: {pcount:post_page_count},
            success:
                function(result){


                    $("#gizinfi").append(result);
                    }
        });
        };
});
});
&lt;/script&gt;

I don't know whats the problem is. It's working great on local PC with WAMP but at online server its showing error. Can anyone please please help me to know what's the problem is? Please help...