dompdf / dompdf/dompdf

chmod fonts folder as part of composer post install.

Open
#1,238 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
11.2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

I did a quick search through current and past issues/pulls and could not find anything so please forgive me if this has been brought up before.

I just came across an issue where I spent about 3 hours trying to figure out why my fonts were not working on a fresh install of a project I am working on. I then realised I had not updated the permissions on:

vendor/dompdf/dompdf/lib/fonts

Now I am not 100% sure if I should need to update the permissions on these folders or if there is just something funky going on with my environment. However either way I am sure more people than just me have run into this issue, so I was thinking as part of the composer install we could set the permissions on this folder and that way if it was already right no harm done and if not we could save people hours of head ache :)

On my own project I have just added this to the composer.json:

"scripts": {
    "post-root-package-install": [
      "chmod -R 777 vendor/dompdf/dompdf/lib/fonts"
    ],
    "post-install-cmd": [
      "chmod -R 777 vendor/dompdf/dompdf/lib/fonts"
    ],
    "post-update-cmd": [
      "chmod -R 777 vendor/dompdf/dompdf/lib/fonts"
    ]
}

Before I submit a PR can anybody see any reason why this would be a bad idea? Obviously we don'y have to set the permissions to 777 this was just a quick fix.

Cheers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Composer scripts proposed in composer.json and the vendor/dompdf/dompdf/lib/fonts path described in the issue. Check how installation and font permissions are handled, including the suitability of changing permissions during Composer hooks. Done means reaching an agreed, safe approach that addresses fresh-install font access without relying on an unsafe blanket permission change.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.