I am using the print.module and dompdf to convert the PDF files. I am getting the following warning on my pages. How would I go about fixing this?

Warning: file_put_contents(/home/mysite/public_html/sites/all/modules/print/lib/dompdf/lib/fonts/php_Times-Bold.afm): failed to open stream: Permission denied in Cpdf->openFont() (line 2354 of /home/mysite/public_html/sites/all/modules/print/lib/dompdf/lib/class.pdf.php).

Notice: Constant DOMPDF_TEMP_DIR already defined in require_once() (line 73 of /home/mysite/public_html/sites/all/modules/print/lib/dompdf/dompdf_config.inc.php).

Notice: Constant DOMPDF_ENABLE_PHP already defined in require_once() (line 185 of /home/mysite/public_html/sites/all/modules/print/lib/dompdf/dompdf_config.inc.php).

Notice: Constant DOMPDF_ENABLE_REMOTE already defined in require_once() (line 196 of /home/mysite/public_html/sites/all/modules/print/lib/dompdf/dompdf_config.inc.php).


Take a look at the INSTALL.txt file. You need to give the webserver write access to the dompdf/lib/fonts directory.

In my case, I chowned it to apache:apache. Make it mirror how you have your sites/default/files directory set up.

| improve this answer | |
  • Thank you @MPD These are not the correct permissions, is that right? drwxr-xr-x - fonts directory – kine456 Feb 14 '13 at 0:30
  • It totally depends on your situation. My folder is owned by apache, so I can use 755 permissions. Make it the same group/owner as sites/default/files and the same permissions. – mpdonadio Feb 14 '13 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.