Resolution:
The path to the file from which you include the grid php file should be the same in setUrl method. For example, if the grid PHP file is included in a page like this:
... <div> <?php include ("path_to_grid/grid.php");?> </div> ...
Then in the grid PHP file you should use setUrl like this:
<?php ... // Create the jqGrid instance $grid = new jqGridRender($conn); // Write the SQL Query $grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, ShipName, Freight FROM orders'; // Set output format to json $grid->dataType = 'json'; // Let the grid create the model $grid->setColModel(); // Set the url from where we obtain the data $grid->setUrl('path_to_grid/grid.php'); ... ?>
Where path_to_grid is the path to the grid.php file