frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

The docs explain a solution for @php in composer, which will result in issues

Open gisostallenberg opened this issue 1 year ago • 1 comments

What happened?

When using (at least) the docker images for latest and latest-php8.2, the docs at https://frankenphp.dev/docs/known-issues/#composer-scripts-referencing-php suggest adding a script at /usr/local/bin/php, but the actual php binary is already located there. It will result in issues when running PHPStan or Rector, which try to run that PHP binary. Not adding the solution proposed will actually work just fine (also for @php sections in composer.json, so maybe the known issues section is outdated or only targeted at other docker images.

At least a notice about this is justified in the docs, see https://github.com/dunglas/frankenphp/pull/810

Build Type

Docker (Debian Bookworm)

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

N/A

Relevant log output

No response

gisostallenberg avatar May 23 '24 11:05 gisostallenberg

I'm not sure to get the problem. This workaround is relevant only if you use the built-in frankenphp php-cli sub-command. It isn't necessary if you use the classic PHP CLI.

Maybe it's not clear enough in docs?

dunglas avatar May 23 '24 21:05 dunglas

Closing for now, feel free to reopen if I misunderstood.

dunglas avatar May 31 '24 11:05 dunglas

Well... I misunderstood that this is not always needed, so I added a script and put it in /usr/local/bin/php, but when having an actual php binary there, this (off course) results in errors. So I thought to save others from doing the same stupid thing, add a warning that this is only needed in certain situations. For me that was not clear. I understood that "if there is @php in your composer.json" this should always be fixed using the script proposed.

gisostallenberg avatar Jun 04 '24 11:06 gisostallenberg

Good idea for the warning!

dunglas avatar Jun 04 '24 21:06 dunglas