How to override manual_executable_path of ImageAPI Optimize processor [on hold]

27/07/2018


Basically, the problem is that Platform.sh installs JpegTran and PngCrush executables in /usr/bin, but after updating my local development machine’s OS to latest Mac OSX Sierra 10.12.6, some new security feature prevents me from creating a symlink inside /usr/bin to the executables I have installed in /usr/local/bin/.

It seems the System Integrity Protection has been around since El Capitan 10.11, so I have no idea how I had this working before.

The content of the imageapi_optimize.processor.default.yml file is the following.

uuid: 14106544-1334-47e0-b488-726b32bf991c
langcode: en
status: true
dependencies: {  }
name: default
label: Default
processors:
  87360858-e14c-40d6-adac-beac902d3d65:
    uuid: 87360858-e14c-40d6-adac-beac902d3d65
    id: jpegtran
    weight: '1'
    data:
      manual_executable_path: /usr/bin/jpegtran
      progressive: 1
  e2857da8-217c-4a2d-a8de-171bd2105fb1:
    uuid: e2857da8-217c-4a2d-a8de-171bd2105fb1
    id: pngcrush
    weight: '2'
    data:
      manual_executable_path: /usr/bin/pngcrush

I’ve setup sites/default/settings.php to include settings.local.php. I have tried to override these settings by following the suggestions from Configuration override not work from settings.php with the following:

$config['imageapi_optimize.processor.default']['processors']['87360858-e14c-40d6-adac-beac902d3d65']['data']['manual_executable_path'] = '/usr/local/bin/jpegtran';
$config['imageapi_optimize.processor.default']['processors']['e2857da8-217c-4a2d-a8de-171bd2105fb1']['data']['manual_executable_path'] = '/usr/local/bin/pngcrush';

However, the YAML structure for these processors seem a bit abnormal and this doesn’t solve the problem. Accessing the image via an image style URL just returns a WSOD and there isn’t any error message in Apache nor watchdog logs, but there are previous errors in apache_error.log*.

sh: /usr/bin/jpegtran: No such file or directory
sh: /usr/bin/pngcrush: No such file or directory

قالب وردپرس