远程服务器不发送响应头,本地服务器

I have a php file that should be sending response headers, but it isn't. Here is the networking tab of both the local server and the remote server. As you can see, the local server is sending many different headers, but the remote server isn't sending any.

enter image description hereenter image description here

I sent all the response headers using php header(), but since this works perfectly on the local server, im guessing it's a server configuration issue? If anyone has had this issue before, please share an answer - i've been pulling my hair out over this for 3 days now -_-

EDIT thought the php code might help:

<?php 
error_reporting(E_ALL);
//disable browser caching !!IMPORTANT
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: POST, GET"); 
header("Access-Control-Allow-Headers: Random");
header("Access-Control-Expose-Headers: Random");
header("Access-Control-Request-Headers: Random");

theres no whitespace before this php code. Also if there was an issue with this code, surely it wouldnt work on my local server?

Thanks, Josh

Same problem is here;

Try to use ob_start(); just after <?php and use ob_end_flush(); at the end of your document.