Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a Laravel project fails, probably because FrankenPHP doesn't support -r flag #945

Open
hkockerbeck opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hkockerbeck
Copy link

What happened?

When I try to create a new Laravel project with

 ./composer create-project laravel/laravel laraveltest

it fails with

> @php -r "file_exists('.env') || copy('.env.example', '.env');"

Warning: Unknown: Failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Failed opening required '-r' (include_path='.:') in Unknown on line 0
Script @php -r "file_exists('.env') || copy('.env.example', '.env');" handling the post-root-package-install event returned with error code 255

The helper script composer is in the same directory and looks like this

#!/bin/bash
exec ./frankenphp-linux-x86_64 php-cli ./composer.phar $@

It looks like (at least) one step in creating the project tries to use php -r to execute PHP code without a file. As far as I can tell, FrankenPHP doesn't support the -r flag yet. Some experiments underpin that

php -r "echo 'Hello';" # on a "regular" PHP installation, correctly prints 'Hello'

# compared with 

./frankenphp-linux-x86_64 php-cli -r "echo 'Hello';"

Warning: Unknown: Failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Failed opening required '-r' (include_path='.:') in Unknown on line 0

Build Type

Standalone binary

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Not applicable, we don't get that far ;)

Relevant log output

No response

@hkockerbeck hkockerbeck added the bug Something isn't working label Jul 31, 2024
@dunglas
Copy link
Owner

dunglas commented Aug 1, 2024

Indeed, -r isn't supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants