Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sandykao's avatar

vuongxuongminh/laravel-async has error "Declaration of ParentRuntime::createProcess($task, ?int $outputLength = NULL) should be compatible with ParentRuntime::createProcess($task, ?int $outputLength = NULL, ?string $binary = 'php')"

When I execute function, an error message appears:

Declaration of VXM\Async\Runtime\ParentRuntime::createProcess($task, ?int $outputLength = NULL): Spatie\Async\Process\Runnable should be compatible with Spatie\Async\Runtime\ParentRuntime::createProcess($task, ?int $outputLength = NULL, ?string $binary = 'php'): Spatie\Async\Process\Runnable

My installation steps: step 1

composer require vxm/laravel-async

step 2

php artisan vendor:publish --provider="VXM\Async\AsyncServiceProvider" --tag="config"

step 3 IndexController.php

use Async;
class IndexController extends Controller
{
    public function index(Request $request)
    { 
        // do something...

        Async::run(function() {
            Log::info('Async');
        });

    }
}
0 likes
0 replies

Please or to participate in this conversation.