MAMP

You are currently browsing articles tagged MAMP.

I’m currently working on a PHP project focused on PDF report generation. To develop locally, I’m using MAMP Pro 1.9 and TCPDF 4.9.018. Upon installation of TCPDF, I encountered the following errors:

MAMP 403
TCPDF ERROR: Could not include font definition file: helvetica

To overcome these issues:

  1. Check your log files; they will most likely provide additional details about the error your encountering. In my case, the log stated: “Directory index forbidden by rule”. Ensure that proper permissions are applied to the “tcpdf” folder.
  2. Configure the “tcpdf” > “config” > tcpdf_config.php file properly. There are two settings that you need to modify based on your local environment:

define ('K_PATH_MAIN', $k_path_main);
define ('K_PATH_URL', $k_path_url);

Set K_PATH_MAIN to your local “tcpdf” installation directory. Don’t forget the trailing “/”. If you omit the trailing “/” it will cause multiple issues regarding path references when you try to access tcpdf. For example: “/var/www/tcpdf/”.

Set K_PATH_URL to your URL path to tcpdf installation folder. For example: “http://localhost/tcpdf/”.

Tags: , , ,