title: DataTables warning: table id=DataTables_Table_0 - Ajax error. For more information about this error, please see http://datatables.net/tn/7
body: <p>I tried server processing for jQuery data table but getting error:</p>
  
  <blockquote>
    <p>DataTables warning: table id=DataTables_Table_0 - Ajax error</p>
  </blockquote>
  
  <p>and when I remove below code from server.php</p>
  
  <pre><code>require( '/machines/jquery/ssp.class.php' );
  
  echo json_encode(
      SSP::simple( $_POST, $sql_details, $table, $primaryKey, $columns )
  );
  </code></pre>
  
  <p>then getting error:</p>
  
  <blockquote>
    <p>DataTables warning: table id=DataTables_Table_0 - Invalid JSON response</p>
  </blockquote>
  
  <p>Also note that, previously require was: require( 'ssp.class.php' ); as per <a href="https://datatables.net/examples/server_side/post.html" rel="nofollow noreferrer">https://datatables.net/examples/server_side/post.html</a> but I tried to find ssp.class.php in entire / directory in my ubuntu OS but there was no such php file so searched google and copied that file and kept under /machines/jquery/ssp.class.php but still no luck.</p>
  
  <p>I have already checked all the php, pdp .. settings and it is correct so something is wrong in the code or my server doesn't understand the way jQuery given the server processing example.</p>
  
  <p>There is no problem for client side data processing but server side data processing gives above error.</p>
  
  <pre><code> root@m100:~# php -i|grep PDO
   PDO
   PDO support =&gt; enabled
   PDO drivers =&gt; mysql
   PDO Driver for MySQL =&gt; enabled
  </code></pre>
  
  <p>client.php:</p>
  
  <pre><code>&lt;div&gt;
  
  &lt;h3&gt;Machines Data&lt;/h3&gt;
  &lt;div class="container"&gt;
      &lt;div id="machines-data" style="padding-left: 15px; padding-right:  15px;"&gt;&lt;/div&gt;
  
      &lt;table class="table machines-data" border="1"&gt;
  
      &lt;/table&gt;
  
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  
  &lt;script&gt;
  
  $(document).ready(function () {
  
  });
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script&gt;
   $(function(){
      $("#progress").show();
  
          $(".machines-data").dataTable({
              "processing": true,
              "serverSide": true,
              "ajax": { "url": "/machines/server.php", "type": "POST" },
              "columns": [
          { "data": "id" },
          { "data": "ip" },
          { "data": "machine" },
          { "data": "action" },
      ]
  
          });
    })
   &lt;/script&gt;
  </code></pre>
  
  <p>server.php:</p>
  
  <pre><code>&lt;?php
  
  ignore_user_abort(true);
  
  if($_POST) {
  
  $table = '1_machine_data';
  
  $primaryKey = 'id';
  
   $columns = array(
       array( 'db' =&gt; 'id', 'dt' =&gt; 'id' ),
       array( 'db' =&gt; 'ip',  'dt' =&gt; 'ip' ),
       array( 'db' =&gt; 'machine',   'dt' =&gt; 'machine' ),
       array( 'db' =&gt; 'action',     'dt' =&gt; 'action' ),
   );
  
  $sql_details = array(
      'user' =&gt; 'root',
      'pass' =&gt; 'pass',
      'db'   =&gt; 'machine',
      'host' =&gt; 'localhost'
  );
  
  require( '/machines/jquery/ssp.class.php' );
  
  echo json_encode(
       SSP::simple( $_POST, $sql_details, $table, $primaryKey, $columns )
  );
  
  exit (0);
  
  }
  
  ?&gt;
  </code></pre>