roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Add ImageMagick, ghostscript, bc_math and PDF thumbnails #1292

Closed joshuafredrickson closed 3 years ago

joshuafredrickson commented 3 years ago

Addresses #1108

swalkinshaw commented 3 years ago

Thank you 🎉 tested and site health all passes

strarsis commented 3 years ago

What about adding the PHP SOAP extension? Some plugins for WooCommerce use/need it. You may find this PHP extensions table interesting: https://github.com/strarsis/docker-php-bedrock/blob/main/README.md#php-extensions

Edit: Would this config be better for imagemagick PDF configuration as it is imagemagick version-agnostic?

# ImageMagick fix (allow reading PDFs)
# https://alexvanderbist.com/posts/2018/fixing-imagick-error-unauthorized
- name: Find ImageMagick directories
  find:
    paths: /etc
    pattern: "ImageMagick(?:-\\d)"
    file_type: directory
    use_regex: yes
  register: imagemagick_directories

- name: Allow ImageMagick coder to read and write
  lineinfile:
    dest: "{{ item.path }}/policy.xml"
    regexp: '\s*<policy domain="coder" rights="none" pattern="PDF" />'
    line: '  <policy domain="coder" rights="read|write" pattern="PDF" />'
    backrefs: yes
  with_items: "{{ imagemagick_directories.files }}"
  notify: reload php-fpm
strarsis commented 3 years ago

@joshuafredrickson: Pardon my ignorance, but I can't find where in this PR the bc_math PHP extension is added. 😼