1

i am using MPDF for generating Multiple PDF Files in PHP in a loop. Some of PDF Files are so big for that purpose in a loop i have also define PHP functions for increase time limit etc.

ini_set('max_execution_time', 0);
ini_set("memory_limit", "512M");
set_time_limit(0);

But still it show me an 500 internal server error on server, works fine on local

Hassan Shafique
  • 147
  • 2
  • 14
  • 2
    on the error reporting and try what error it display – Bhupendra Mistry Dec 05 '17 at 08:15
  • 2
    Check the PHP error log to see the reason. – Barmar Dec 05 '17 at 08:25
  • 1
    Setting the memory limit to 50 GB is not a good solution, as this hides the real problem and leads to new problems (does the server have 50 GB of RAM? What if the script is called multiple times concurrently?) – Nico Haase Dec 05 '17 at 08:27
  • @NicoHaase you are right and 50 GB just as an example. – Hassan Shafique Dec 05 '17 at 08:42
  • i have turn error reporting also but it didn't show any error except 500 internal server error and this error for generating big files.@Barmar – Hassan Shafique Dec 05 '17 at 10:51
  • See https://stackoverflow.com/questions/2687730/how-can-i-make-php-display-the-error-instead-of-giving-me-500-internal-server-er and find the PHP error causing the 500 status code. Unless you do that, we are not able to help. – Finwe Dec 07 '17 at 07:07
  • check library path is correct `require_once './vendor/autoload.php';` – vahid sabet Sep 24 '20 at 07:03

0 Answers0