I want to display an external pdf on my own site. To do so, I have this code:
$bigPDF = 'https://www.courtlistener.com/recap/gov.uscourts.dcd.219024/gov.uscourts.dcd.219024.9.0_1.pdf';
$smallPDF = 'https://www.courtlistener.com/recap/gov.uscourts.dcd.219024/gov.uscourts.dcd.219024.9.1_1.pdf';
header('Content-type: application/pdf');
readfile($bigPDF);
When I try to run it on my Google Cloud Platform server, I get this error several times, and then the server crashes:
ERROR: unable to read what child say: Bad file descriptor (9)
However, if I change readfile($bigPDF)
to readfile($smallPDF)
, the code works fine and the pdf displays properly.
Also, both pdfs display fine on my local dev server. It is only when I upload to the Google Cloud Platform that the big docket crashes the server. To me, this means that the error probably has something to do with my Google Cloud server settings, but with such an undescriptive error code, I don't know where to start looking.