diff --git a/docs/known-issues.md b/docs/known-issues.md index 012ea61f..bc7cdbac 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -80,7 +80,7 @@ docker run \ dunglas/frankenphp ``` -> ![CAUTION] +> [!CAUTION] > > Be sure to replace `172.17.0.3` with the IP that will be assigned to your container. @@ -96,3 +96,27 @@ docker run \ -p 80:80 -p 443:443 -p 443:443/udp \ dunglas/frankenphp ``` + +## Composer Scripts Referencing `@php` + +[Composer scripts](https://getcomposer.org/doc/articles/scripts.md) may want to execute a PHP binary for some tasks, e.g. in [a Laravel project](laravel.md) to run `@php artisan package:discover --ansi`. This [currently fails]((https://github.com/dunglas/frankenphp/issues/483#issuecomment-1899890915)) for two reasons: + +* Composer does not know how to call the FrankenPHP binary; +* Composer may add PHP settings using the `-d` flag in the command, which FrankenPHP does not yet support. + +As a workaround, we can create a shell script in `/usr/local/bin/php` which strips the unsupported parameters and then calls FrankenPHP: + +```sh +#!/bin/sh + +# iterate over $@. if the current argument is -d, remove the argument and the next one +for i in "$@" +do + if [ "$i" = "-d" ]; then + shift + shift + fi +done + +/usr/local/bin/frankenphp php-cli "$@" +```