I have recently setup a new LAMP server, everything is working fine for my webapp except when trying to export files using fpdf. It worked fine on my other hosting provider but I cannot get it to work here. I get a “This page isn’t working” “xxxxxx is currently unable to handle this request” “HTTP ERROR 500”

Is there some web configuration I have overlooked to allow this to work ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @JamesAus,

I would recommend checking out your error logs. The information should be displayed there as to why it’s not working and it’s giving you this one.

Usually, the HTTP ERROR 500 is related to the code itself rather than the server so you’ll need to create a php error_log and recreate the issue. Once the issue is recreated the error will be logged in the file you’ve created. To enable PHP error logging, you need to set two directives in your php.ini file:

log_errors
error_log

First, use a text editor to set the log_errors directive as shown:

log_errors = On

Next, set the error_log directive to log PHP errors to a specific file. Replace path with the path to the log file, and filename with the log filename:

error_log = /path/filename

That’s it, you now have the error log enabled.

Regards,
KFSys

  • Thanks KFSys for your reply and info. I tried as you suggested, creating an errors.log file but nothing was written to it when reproducing the problem. Also nothing is logged re this in the Apache logs. The exact same script has been working fine on my Hostgator account but throws this http error here.

    • Hi @JamesAus,

      How did you create the PHP error log file? I mean is it for your application or you created it for the whole server?

      Additionally, if you run the PHP script the following way from your console

      php /path/to/php/script.php
      

      What error does it return?

Submit an Answer