Skip to content

Instantly share code, notes, and snippets.

@gabesullice
Last active January 10, 2023 16:04
Show Gist options
  • Save gabesullice/99bacdf28d388df4f37f4c5821a1118e to your computer and use it in GitHub Desktop.
Save gabesullice/99bacdf28d388df4f37f4c5821a1118e to your computer and use it in GitHub Desktop.
FrankenPHP w/ Drupal notes
  • Overrides
    • Changed the root directive in the Caddyfile to web instead of public
    • Used -v $PWD:/app instead of /app/public
    • Added error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT to php.ini and used -v $PWD/php.ini:/usr/local/lib/php.ini to suppress warnings. Deprecations were still being printed out.
  • Observations
    • Many warnings like this one: **Warning**: ini_set(): Session ini settings cannot be changed after headers have already been sent in **/app/web/core/lib/Drupal/Core/DrupalKernel.php** on line **1000**
    • Many deprecations were printed out, such as: __Deprecated function__: Creation of dynamic property Drupal\Core\Installer\InstallerKernel::$_serviceId is deprecated in __Drupal\Core\DependencyInjection\ContainerBuilder->set()__ (line __83__ of __/app/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php__).
    • Drupal is still not compatible with PHP 8.2: https://www.drupal.org/project/drupal/issues/3283358
    • FrankenPHP compiles PHP from source, so it's bleeding edge
    • FrankenPHP is not compiled with thembstring extension
    • Had to clone --recursive or building the docker image raised the error: fatal error: C-Thread-Pool/thpool.h: No such file or directory
    • gd extension is not available
      • Can't proceed past the Drupal installation wizard without GD
      • Tried to compile it in by making various unsuccessful modifications
        • Kept receiving this error:/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/ld: /usr/local/lib/libphp.a(gd_gd2.o): undefined reference to symbol 'compress' /usr/bin/ld: /lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
  • Bugs
    • Default command to start frankenphp does not work because Caddy cannot add its TLS key to the local trust store
      • Overrode /etc/Caddyfile by prefixing the host name with http:// in order to disable HTTPS
      • Used -v $PWD/Caddyfile:/etc/Caddyfile to replace it
  • Miscellaneous
    • localhost didn't work for me even after the HTTPS overrides above
      • Used -e SERVER_NAME=frankenphp.test and added frankenphp.test to my /etc/hosts file
@bbrala
Copy link

bbrala commented Oct 17, 2022

To compile with gd you are probably missing a dependency.

Probably one of these: "On Ubuntu I was missing the libpng-dev, libjpeg-dev (and in my case) libwebp-dev libraries"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment