Closed francsiswanto closed 3 years ago
Laravel Octane will not work on Windows.
The pcntl extension is required and it is not available on windows.
Use Sail https://github.com/laravel/sail
Laravel Octane will not work on Windows.
The pcntl extension is required and it is not available on windows.
Thank you for this info, it would be way better if documentation in https://laravel.com/docs/8.x/octane mention about this fact.
I found a magic way to run roadrunner on windows.
before do this, download roadrunner manually
php artisan make:command StartOctane
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class StartOctane extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:start-octane {--host=127.0.0.1} {--port=8000} {--workers=1}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
$path = storage_path('logs/octane-server-state.json');
if (file_exists($path)) {
unlink($path);
}
$this->call('octane:start', [
'--host' => $this->option('host'),
'--port' => $this->option('port'),
'--workers' => $this->option('workers'),
]);
}
}
then run
php .\artisan app:start-octane
You will see it works!!!
direct run octane:start on windows
use command
@iVampireSP I tried your code, I downloaded road-runner as stated here: https://roadrunner.dev/docs/intro-config/current/en by using the following commands:
composer require spiral/roadrunner-cli
./vendor/bin/rr get-binary
and I got the file rr.exe
in the root of my project.
then copied your command, but got the following error:
Although when I run the regular octane:start I get the usual error:
Any ideas ?
@iVampireSP I tried your code, I downloaded road-runner as stated here: https://roadrunner.dev/docs/intro-config/current/en by using the following commands:
composer require spiral/roadrunner-cli
./vendor/bin/rr get-binary
and I got the file
rr.exe
in the root of my project.then copied your command, but got the following error:
Although when I run the regular octane:start I get the usual error:
Any ideas ?
I encountered the same issue after runing the custom command suggested by @iVampireSP . The solution was to install spiral/roadrunner-http:^3.3.0
, after that, the command suggested by @iVampireSP works.
Explanation:
Octane checks for Roadrunner installation using the isRoadRunnerInstalled()
function, which verifies the existence of the PSR7Worker::class. This class is part of the roadrunner-http package.
If you want to know where i got the roadrunner-http, you can check the function ensureRoadRunnerPackageIsInstalled()
function inside Laravel\Octane\Commands\Concerns\InstallsRoadRunnerDependencies
, in there you have this:
Oh and sorry for commenting on a closed issue. Cheers!
Description 1:
Command of "artisan octane:install" not working properly and force me to download rr binary manually at https://github.com/spiral/roadrunner-binary/releases, this is the error messages:
Description 2:
Command of "artisan octane:start" also not working with this error messages:
Comparing to other package:
Since laravel/octane does not working on my laptop, I've tried other package, https://github.com/spiral/roadrunner-laravel with brand new installation of Laravel 8 and it is working, and also working on my existing Laravel 8 project without major problem.
Please help, how do I fix this problem?
Thank you.