Category Archives: Tips

Internal Server Error on PHP Scripts

Sometimes when trying to run or install a PHP script you’ll see a screen with heading “Internal Server Error”. People usually rush to contact the script developer but this is the worst thing to do. Internal Server Error means server misconfiguration and the developer is unlikely to be able to help you.

Here is what to do:

1. Check file permissions. In  more than 90% of the cases the error is caused by wrong permissions on the uploaded file.

2. Check your server error log. Poorly configured servers will often output Internal server error when there is fatal PHP error for some reason. Fortunately these errors are recorded in the server error log. Even if you don’t know what the errors mean you’ll have some useful information to send to the script developer instead of asking them to guess out the reason for the Internal server error.

3. Contact your hosting support. You should contact your hosting support before contacting the software developer. They are responsible for your server setup and you are paying them every month to keep things running smooth.

Free PDF Bridge Plugin for WordPress Developers

Note: This plugin was initially developed for our WatuPRO customers (more info here) but it’s not limited to a specific plugin. So we are releasing it to other developers.

What Does the PDF Bridge Do?

This plugin lets you apply WordPress filter to any piece of content and convert it to PDF. Simple as that. Depending on the version you download it uses the html2fpdf library or the MPDF library.

How To Use It In Your Plugin Or Theme?

The plugin is super simple (you could very well write it yourself) and adds a filter that can be used from your plugin or theme. The filter name is “pdf-bridge-convert” and all you need to do it, is to apply it to your HTML content. Then don’t forget to output PDF headers when sending the content to the user. Here is an example assuming you have your HTML in $content:

$content = apply_filters("pdf-bridge-convert", $content);
header('Content-Length: '.strlen($content));
header('Content-type: application/pdf');
echo $content;
exit;

Download

The plugin has two versions:

  • Version 0.2 that uses html2fpdf library. It’s small (121 KB) but doesn’t work with complex designs or foreign languages.
  • Version 0.6 that uses MPDF library. It’s large (12.9 MB) but works with different languages and complicated designs.

Enjoy and let us know if you think it needs improvements.