I need to create a PDF on a PHP page for a client whose web host has disabled fopen. All of the PHP->PDF frameworks I’ve seen so far use fopen to add images to the PDF. Is there either a framework that doesn’t use fopen, or another way to create PDFs in PHP.
I’ve used the FPDF framework up to now, and looked at dompdf and mpdf. (I’ve got a few others to look at but thought I’d ask here if someone has got experience).
I tried using curl with FPDF but ran into streaming errors.
Thanks,
Adrian
If
fopenis disabled, it is very likely that all other functions to access the file system (likefile_get_contents()) are disabled as well. A PHP PDF library will have to use some function to access the image, so there is probably no way to do this under the current conditions.Your client will have to talk to the web host about re-enabling those functions, or look for a new provider. That might be a good idea anyway: disabling all filesystem functions is really excessive and silly, and possibly a symptom of bigger underlying security issues – I can see no reason to do this on a properly configured system.