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

[Bug]: PHP_BINARY returns the wrong binary causing issues with Laravel Concurrency facade #986

Closed
heychazza opened this issue Sep 13, 2024 · 2 comments
Labels

Comments

@heychazza
Copy link

Platform

macOS

Operating system version

macOS Sonoma 14.6.1

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.11.0 (Build 33)

PHP Version

PHP 8.3.11 (cli) (built: Sep 10 2024 15:12:42) (NTS)

Bug description

When using the Concurrency facade, specifically the run method, the following error is triggered:

The command "'php' 'artisan' 'invoke-serialized-closure'" failed. Working directory: /Users/charlie/Development/Sites/example Error: proc_open(): posix_spawn() failed: No such file or directory

For context, this only errors when going through Laravel Herd. If I run this through php artisan serve the code runs fine.

I have even tried a re-install of Herd and the same error.

Steps to reproduce

Create an endpoint like the following:

Route::get('/concurrency', function () {
    [$first, $second] = Concurrency::run([
        fn () => 1+1,
        fn () => 2+2,
    ]);

    return response()->json([
        'first' => $first,
        'second' => $second,
    ]);
});

If you go to <site>.test/concurrency (running through Herd) you'll hit that error.

Now do php artisan serve and go to 127.0.0.1:8000/concurrency and the code will run fine.

Relevant log output

No response

@sschlein
Copy link
Member

We've created a fix for the underlying Symfony component at symfony/symfony#58258 and it will be available with their 7.2 release.

@mpociot
Copy link
Member

mpociot commented Sep 17, 2024

laravel/framework#52791

This has also been fixed in Laravel itself and will be released shortly.

@mpociot mpociot closed this as completed Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants