dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.7k stars 220 forks source link

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

Closed gisostallenberg closed 3 months ago

gisostallenberg commented 3 months ago

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

dunglas commented 3 months ago

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 commented 3 months ago

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

gisostallenberg commented 3 months ago

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.

dunglas commented 3 months ago

Good idea for the warning!