Coder Social home page Coder Social logo

octane's Introduction

Logo Laravel Octane

Build Status Total Downloads Latest Stable Version License

Introduction

Laravel Octane supercharges your application's performance by serving your application using high-powered application servers, including FrankenPHP, Open Swoole, Swoole, and RoadRunner. Octane boots your application once, keeps it in memory, and then feeds it requests at supersonic speeds.

Official Documentation

Documentation for Octane can be found on the Laravel website.

Contributing

Thank you for considering contributing to Octane! You can read the contribution guide here.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

Laravel Octane is open-sourced software licensed under the MIT license.

octane's People

Contributors

barryvdh avatar chu121su12 avatar crynobone avatar deepdiver1975 avatar driesvints avatar dunglas avatar ejulen avatar eleven26 avatar foremtehan avatar kiddtang avatar masterjus avatar namoshek avatar nirodeveloper avatar nuernbergera avatar nunomaduro avatar owenvoke avatar rochdinassah avatar sebdesign avatar shuvroroy avatar sikhlana avatar smortexa avatar stillzombie avatar stylecibot avatar sy-records avatar tarampampam avatar taylorotwell avatar themsaid avatar timacdonald avatar vokamut avatar xorinzor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

octane's Issues

Key file '/ssl/server.key' does not exists

  • Octane Version: 0.1.1
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: RoadRunner
  • Database Driver & Version: MySQL 8.0

Description:

When I follow the doc to step php artisan octane:start, I get errors.

   INFO  Server running…

  Local: http://127.0.0.1:8000

  Use Ctrl+C to stop the server


   ERROR  2021-04-10T11:15:32.349+0800  ERROR   container/init.go:74    error calling internal_init     {"vertex id": "http.Plugin", "error": "http_plugin_init:\n\tvalidation:\n\tssl_valid: key file '/ssl/server.key' does not exists"}

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).callInitFn

   ERROR        github.com/spiral/[email protected]/pkg/container/init.go:74

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).internalInit

   ERROR        github.com/spiral/[email protected]/pkg/container/init.go:26

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Initialize

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:378

   ERROR  reflect.Value.call

   ERROR        reflect/value.go:476

   ERROR  reflect.Value.Call

   ERROR        reflect/value.go:337

   ERROR  github.com/spiral/endure/pkg/fsm.(*FSMImpl).Transition

   ERROR        github.com/spiral/[email protected]/pkg/fsm/fsm.go:180

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Init

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:293

   ERROR  github.com/spiral/roadrunner-binary/v2/internal/cli/serve.NewCommand.func1

   ERROR        github.com/spiral/roadrunner-binary/v2/internal/cli/serve/command.go:53

   ERROR  github.com/spf13/cobra.(*Command).execute

   ERROR        github.com/spf13/[email protected]/command.go:852

   ERROR  github.com/spf13/cobra.(*Command).ExecuteC

   ERROR        github.com/spf13/[email protected]/command.go:960

   ERROR  github.com/spf13/cobra.(*Command).Execute

   ERROR        github.com/spf13/[email protected]/command.go:897

   ERROR  main.run

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:22

   ERROR  main.main

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:16

   ERROR  runtime.main

   ERROR        runtime/proc.go:225

   ERROR  2021-04-10T11:15:32.349+0800  ERROR   container/init.go:31    error occurred during the call INIT function    {"vertex id": "http.Plugin", "error": "endure_call_init_fn: Function call error:\n\thttp_plugin_init:\n\tvalidation:\n\tssl_valid: key file '/ssl/server.key' does not exists"}

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).internalInit

   ERROR        github.com/spiral/[email protected]/pkg/container/init.go:31

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Initialize

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:378

   ERROR  reflect.Value.call

   ERROR        reflect/value.go:476

   ERROR  reflect.Value.Call

   ERROR        reflect/value.go:337

   ERROR  github.com/spiral/endure/pkg/fsm.(*FSMImpl).Transition

   ERROR        github.com/spiral/[email protected]/pkg/fsm/fsm.go:180

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Init

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:293

   ERROR  github.com/spiral/roadrunner-binary/v2/internal/cli/serve.NewCommand.func1

   ERROR        github.com/spiral/roadrunner-binary/v2/internal/cli/serve/command.go:53

   ERROR  github.com/spf13/cobra.(*Command).execute

   ERROR        github.com/spf13/[email protected]/command.go:852

   ERROR  github.com/spf13/cobra.(*Command).ExecuteC

   ERROR        github.com/spf13/[email protected]/command.go:960

   ERROR  github.com/spf13/cobra.(*Command).Execute

   ERROR        github.com/spf13/[email protected]/command.go:897

   ERROR  main.run

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:22

   ERROR  main.main

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:16

   ERROR  runtime.main

   ERROR        runtime/proc.go:225

   ERROR  2021-04-10T11:15:32.349+0800  ERROR   container/endure.go:392 error during the internal_init  {"error": "endure_internal_init: Function call error:\n\tendure_call_init_fn:\n\thttp_plugin_init:\n\tvalidation:\n\tssl_valid: key file '/ssl/server.key' does not exists"}

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Initialize

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:392

   ERROR  reflect.Value.call

   ERROR        reflect/value.go:476

   ERROR  reflect.Value.Call

   ERROR        reflect/value.go:337

   ERROR  github.com/spiral/endure/pkg/fsm.(*FSMImpl).Transition

   ERROR        github.com/spiral/[email protected]/pkg/fsm/fsm.go:180

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).Init

   ERROR        github.com/spiral/[email protected]/pkg/container/endure.go:293

   ERROR  github.com/spiral/roadrunner-binary/v2/internal/cli/serve.NewCommand.func1

   ERROR        github.com/spiral/roadrunner-binary/v2/internal/cli/serve/command.go:53

   ERROR  github.com/spf13/cobra.(*Command).execute

   ERROR        github.com/spf13/[email protected]/command.go:852

   ERROR  github.com/spf13/cobra.(*Command).ExecuteC

   ERROR        github.com/spf13/[email protected]/command.go:960

   ERROR  github.com/spf13/cobra.(*Command).Execute

   ERROR        github.com/spf13/[email protected]/command.go:897

   ERROR  main.run

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:22

   ERROR  main.main

   ERROR        github.com/spiral/roadrunner-binary/v2/cmd/rr/main.go:16

   ERROR  runtime.main

   ERROR        runtime/proc.go:225

   ERROR  handle_serve_command: Init error:

   ERROR        endure_initialize:

   ERROR        endure_internal_init: Function call error:

   ERROR        endure_call_init_fn:

   ERROR        http_plugin_init:

   ERROR        validation:

   ERROR        ssl_valid: key file '/ssl/server.key' does not exists

Steps To Reproduce:

Response doesn't support stream-based output

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.1
  • PHP Version: 8.0.3
  • Database Driver & Version:

Description:

Most of PHP's output usages like echo, var_dump output its content to buffer. In Swoole's case the result will print on console instead of web.

It seems this partial code in SwooleClient.php refers from here

protected function sendResponseContent(Response $response, SwooleResponse $swooleResponse): void
{
if ($response instanceof StreamedResponse && property_exists($response, 'output')) {
$swooleResponse->end($response->output);
return;
} elseif ($response instanceof BinaryFileResponse) {
$swooleResponse->sendfile($response->getFile()->getPathname());
return;
}
$content = $response->getContent();
if (strlen($content) <= 8192) {
$swooleResponse->end($content);
return;
}
foreach (str_split($content, 8192) as $chunk) {
$swooleResponse->write($chunk);
}
$swooleResponse->end();
}
because the output property doesn't exist in symfony's response object. The output property is set from here in swooletw/laravel-swoole.

Symfony\Component\HttpFoundation\StreamedResponse doesn't support getContent and setContent for setting output content, so I fetch buffer output and set the result to response's output property manually.

If Octane is going to support stream output, it needs to use ob_ functions to catch stream content as well.

Many thanks to the official team for integrating Swoole into Laravel!

Steps To Reproduce:

echo 'hello world';

var_dump('Swoole is awesome');

response()->streamDownload(function () {
    echo file_get_contents("https://github.com/laravel/laravel/blob/8.x/README.md");
    }, 'laravel-readme.md');
});

Wrong asset url generated when using the `mix()` helper method

  • Octane Version: 0.1.1
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole
  • Database Driver & Version: MySQL 8.0.23

Description:

When I start octane using the octane:start command, the server is running on 127.0.0.1:8000. In my .env file I set the APP_URL to http://127.0.0.1. I am able to see the app in the browser when visiting 127.0.0.1:8000 but the assets are not loaded since the url is generated as http://localhost:8080. I tried different variations of the app url (with scheme, without scheme, localhost, 127.0.0.1, with port) but I am unable to get it working.

Steps To Reproduce:

  • Run php artisan octane:start
  • Navigate to 127.0.0.1:8000
  • Inspect the network tab

Lumen 8.x Support

Hello! Are you planning to support Lumen Framework in the stable version? Thank you!

memory leak

  • Octane Version:0.1.0
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole-4.6.5

Description:

i just install laravel,swoole,octane

and start with "php artisan octane:start --port=13000 --watch"

add code like this:

<?php


namespace App\Http\Controllers;


class TestController extends Controller
{
    public function index()
    {
        return memory_get_usage()/1024/1204;
    }
}

and this:

Route::get('/test', App\Http\Controllers\TestController::class."@index");

then did nothing

and i requested "http://127.0.0.1:13000/api/test" in chrome ,often and often

i got these respopnse:
13.533650851329
13.710976432724
13.747858700166
...
15.084081706811
...

The numbers are not going down

dd() error with octane:swoole server

  • Octane Version: 0.1.1
  • Laravel Version: v8.35.1
  • PHP Version: 8.0.2

Description:

calling of dd() function throws below error:

{
    "message": "swoole exit",
    "exception": "Swoole\\ExitException",
    "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/symfony/var-dumper/Resources/functions/dump.php",
    "line": 41,
    "trace": [
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/app/Http/Controllers/MessageController.php",
            "line": 154,
            "function": "dd"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "store",
            "class": "App\\Http\\Controllers\\MessageController",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 254,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\ControllerDispatcher",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
            "line": 197,
            "function": "runController",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 695,
            "function": "run",
            "class": "Illuminate\\Routing\\Route",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Routing\\{closure}",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/app/Http/Middleware/EnsureSupportedVersion.php",
            "line": 19,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "App\\Http\\Middleware\\EnsureSupportedVersion",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/app/Http/Middleware/IsActivated.php",
            "line": 48,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "App\\Http\\Middleware\\IsActivated",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/app/Http/Middleware/Localization.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "App\\Http\\Middleware\\Localization",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
            "line": 50,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 127,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 103,
            "function": "handleRequest",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 55,
            "function": "handleRequestUsingNamedLimiter",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
            "line": 44,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Auth\\Middleware\\Authenticate",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 697,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 672,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 636,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 625,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 166,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
            "line": 86,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/fruitcake/laravel-cors/src/HandleCors.php",
            "line": 57,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Fruitcake\\Cors\\HandleCors",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 141,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 110,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/octane/src/ApplicationGateway.php",
            "line": 36,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/octane/src/Worker.php",
            "line": 94,
            "function": "handle",
            "class": "Laravel\\Octane\\ApplicationGateway",
            "type": "->"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/octane/bin/swoole-server",
            "line": 119,
            "function": "handle",
            "class": "Laravel\\Octane\\Worker",
            "type": "->"
        },
        {
            "function": "{closure}"
        },
        {
            "file": "/Applications/XAMPP/xamppfiles/htdocs/webservice/vendor/laravel/octane/bin/swoole-server",
            "line": 169,
            "function": "start",
            "class": "Swoole\\Server",
            "type": "->"
        }
    ]
}

RR handles requests slow at start, then very fast randomly

  • Octane Version: 0.1.0
  • Laravel Version: 8.35
  • PHP Version: 8.0
  • Database Driver & Version: MariaDB

Description:

image

Slow request:
image

Fast request:
image

Steps To Reproduce:

I am not sure, this always happens on start. They were literally a second apart from each other. I just spammed cmd + R & it randomly starts being fast. Headers, models, events, cache & redis tabs show literally the same thing, they differ only about a few points of a millisecond.

Unable to serve static resources from a symink folder.

  • Octane Version: beta
  • Laravel Version: 8.35.1
  • PHP Version: 8.0.3

Description:

Octane is unable to serve static resources configured through a symlink. I have a separate node project where I keep my static resource (js & css files) I then use a symlink to reference these from the laravel's public folder
/home/naveed/laravel/public/assets -> /home/naveed/ui/build/assets/

Octane is using realpath which resolves the symlink thus making it incomptible to render static resources. http://127.0.0.1:8000/assets/main.css that results in a 404 Not Found.

  public function canServeRequestAsStaticFile(Request $request, RequestContext $context): bool
    {
        if (! ($context->publicPath ?? false) ||
            $request->path() === '/') {
            return false;
        }

        $publicPath = $context->publicPath;

        return $this->fileIsServable(
            $publicPath,
            realpath($publicPath.'/'.$request->path()),
        );
    }

Removing the realpath solves the problem but I am not sure if it has any security implications.

Add websocket support for swoole

Seeing as Swoole supports websockets out of the box, it would be cool to have this as a configurable option.

I had a quick play and simply changing Swoole\Http\Server to Swoole\Websocket\Server in bin/createSwooleServer.php appears to mostly work - I also had to define at least a single on("message") handler as well in bin/swoole-server before the server is started.

The only roadblock I can think of is that I imagine @taylorotwell you may prefer it if websockets were tied in with native laravel auth/ event stuff? Currently it would be only raw socket messaging.

Broadcast routes responds with 403 when using octane:swoole server

  • Octane Version: v0.1.0
  • Laravel Version: v8.35.1
  • PHP Version: v8.0.2
  • Database Driver & Version: mysql
  • Broadcast Driver & Version: pusher:v4.1.5

Description:

when using octane:swoole server, Broadcast routes always return 403 error.
[GET]: {{url}}/broadcasting/auth?channel_name=User.1 403

when using artisan serve everything works fine
[GET]: {{url}}/broadcasting/auth?channel_name=User.1 200

Steps To Reproduce:

  1. php artisan octane:start
  2. [GET]: {{url}}/broadcasting/auth?channel_name=User.1

Freeze

  • Octane Version: v1
  • Laravel Version: 8.36..1
  • PHP Version: 8.0.3
  • Database Driver & Version: mysql8
  • php --ri swoole
    Swoole => enabled
    Author => Swoole Team [email protected]
    Version => 4.6.4
    Built => Mar 29 2021 10:46:54
    coroutine => enabled with boost asm context
    epoll => enabled
    eventfd => enabled
    signalfd => enabled
    cpu_affinity => enabled
    spinlock => enabled
    rwlock => enabled
    sockets => enabled
    openssl => OpenSSL 1.1.1f 31 Mar 2020
    dtls => enabled
    http2 => enabled
    json => enabled
    curl-native => enabled
    pcre => enabled
    mutex_timedlock => enabled
    pthread_barrier => enabled
    futex => enabled
    mysqlnd => enabled
    async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

Description:

i can only get to login page , and after the login page , the home page loads and only some elements are visible , then the page freezes and never receives any response .

what i noticed is that the livewire components or the ones that have alpine.js in them are not being loaded .
to reproduce , install by composer mediconesystems/livewire-datatables , and just make a datatable .

SSL support for Swoole HTTP Server not working

  • Octane Version: 0.1.1
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole 4.6.4

Description:

When using Swoole HTTP Server directly without nginx as proxy - then we need to configure SSL.

In Swoole it looks like this:

$server = new Swoole\HTTP\Server(
   "0.0.0.0", 
   9501, 
   SWOOLE_PROCESS, 
   SWOOLE_SOCK_TCP | SWOOLE_SSL
);

$server->set([
  'ssl_cert_file' => '/etc/nginx/ssl/direct.example.com/3456789/server.crt',
  'ssl_key_file' => '/etc/nginx/ssl/direct.example.com/3456789/server.key',
  'ssl_ciphers' => 'TLS13-AES-256-GCM-SHA384:TLS13-...', // long string
]);

However, we cannot add the SWOOLE_SSL to the Server arguments in here: https://github.com/laravel/octane/blob/master/bin/createSwooleServer.php#L10

Can we please expose this as a config?

[docs] Caveats issue clarification

I don't think the caveat sections is entirely clear, at least for first comers, when dealing with register() and boot(), but the examples only use boot() and the PHPDoc says "Register any application services.", which should be done in the register() method.

Assuming these caveats affect both register() and boot() methods equally, shouldn't be better to move the examples to the register() method? Or the examples are as intended, meaning, registering singletons at booting?

Why is there no .env.example file?

In config/octane.php it reference ENV variables, however, there is no .env.example file is this intentional? or should this be added?

DatabaseManager reads stale config data

  • Octane Version: 0.3.1
  • Laravel Version: 8.37.0
  • PHP Version: 8.0.2
  • Server: Swoole
  • Database Driver & Version: Postgres

Description:

If you have any dynamic database configuration values (e.g. schema in a multi-tenant system), the DatabaseManager will not get a refreshed application instance and will always have stale data.

Steps To Reproduce:

Config::set('database.connections.pgsql.schema', 'new');
AnyModel::getConnection()->getConfig(); // will produce the old config

Swoole\Process::kill(): swKill(xxxx, 15) failed, Error: No such process[3]

  • Octane Version: v0.1.0
  • Laravel Version: v8.36.0
  • PHP Version: 8.0.3
  • Database Driver & Version: Not Related
  • Distro: debian:buster (Docker)

** NOT USING LARAVEL SAIL **

Description:

When using Ctrl+C to stop the server the following exception is thrown:

 ErrorException

  Swoole\Process::kill(): swKill(7127, 15) failed, Error: No such process[3]

  at vendor/laravel/octane/src/Swoole/SwooleExtension.php:18
     14▕      * @return bool
     15▕      */
     16▕     public function dispatchProcessSignal(int $processId, string $signal): bool
     17▕     {
➜  18▕         return Process::kill($processId, $signal);
     19▕     }
     20▕
     21▕     /**
     22▕      * Set the current process name.

      +45 vendor frames
  46  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Afterwards the octane-server-state.json is still present and it's impossible to start the server again because of:

 ERROR  Server is already running.

After some research found out that in Laravel\Octane\Swoole\ServerProcessInspector::stopServer() if i remove the:

$this->dispatcher->terminate($masterProcessId, 15)

the server terminates without problems and the octane-server-state.json is missing like it's supposed to, and after when checking with htop both processes (master & manager) are gone.

Steps To Reproduce:

I guess trying with a fresh laravel installation within a debian:buster container to run:

/usr/bin/php -d variables_order=EGPCS /var/www/app/artisan octane:start --server=swoole --host=0.0.0.0 --port=8080 --workers=1

and stop it with Ctrl+C.

Happy to help with anything.

http_plugin_serve_http: cannot bind to "0.0.0.0:80": permission denied, plugin: http.Plugin

Description:

I have followed the instructions using laravel sail to 100%, also did sail build --no-cache but i get this error when trying to run sail up:

 INFO  Server running…
laravel.test_1       | 
laravel.test_1       |   Local: http://0.0.0.0:80 
laravel.test_1       | 
laravel.test_1       |   Use Ctrl+C to stop the server
laravel.test_1       | 
laravel.test_1       | 2021-04-07 08:23:15,094 INFO success: php entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
laravel.test_1       | 
laravel.test_1       |    INFO  error occurred: http_plugin_serve_http: cannot bind to "0.0.0.0:80": permission denied, plugin: http.Plugin
laravel.test_1       | 
laravel.test_1       |    ERROR  2021-04-07T08:23:14.616Z       ERROR   container/poller.go:16  vertex got an error     {"vertex id": "http.Plugin", "error": "http_plugin_serve_http: cannot bind to \"0.0.0.0:80\": permission denied"}

Any ideas on what i have done wrong / what step is missing in the tutorial?

Problem with supervisor and some questions

  • Octane Version: ^0.1.1
  • Laravel Version: ^8.12
  • PHP Version: PHP 8.0.3 (cli)
  • Server: Swoole
  • Database Driver & Version: Not used

Description:

First of all, I will describe my current environment so that you can have a bigger view of what happened in my tests today.

We have an API that runs on top of Laravel, we have many requests per second and we have several servers behind a Loadbalancer to be able to handle all this traffic. A long time ago we were using LaravelS, however we ended up having some memory problems with it and decided to go back to PHP-fpm.

As soon as we saw at Laracon that Octane would be released we became excited. Today in the afternoon I decided to test Octane, because it is a native Laravel package we are almost certain that the problems we had will not exist, as far as I could see the recycling of requests is working perfectly, the same did not happen with LaravelS.

My problem is basically the following: There is a specific route in my API that users call that route calls another API to send messages via WhatsApp. This secondary API is a Docker server. Sometimes this request can take from 0.5 to 10 seconds depending on the Docker server processing. I can't send this message to a queue because I need to return the message's Id to the user.

I reconstructed the flow of my API using the Octane today, it becomes something like this:

api-schema

Everything works perfectly, with only two servers behind the Load Balancer I got great results, but analyzing all this, some doubts appeared.

Inside the swoole_http.log a lot of notifications and errors appeared, I will list 3 of each below:

[2021-04-11 22:42:30 $954.0]    WARNING kill_timeout_process (ERRNO 9012): [Manager] Worker#122[pid=1614] exit timeout, force kill the process
[2021-04-11 22:42:30 $954.0]    WARNING kill_timeout_process (ERRNO 9012): [Manager] Worker#121[pid=1613] exit timeout, force kill the process
[2021-04-11 22:42:30 $954.0]    WARNING kill_timeout_process (ERRNO 9012): [Manager] Worker#120[pid=1612] exit timeout, force kill the process
[2021-04-11 22:42:30 $954.0]    WARNING check_worker_exit_status: worker#121[pid=1613] abnormal exit, status=0, signal=9
[2021-04-11 22:42:30 $954.0]    WARNING check_worker_exit_status: worker#122[pid=1614] abnormal exit, status=0, signal=9
[2021-04-11 22:42:30 $954.0]    WARNING check_worker_exit_status: worker#123[pid=1615] abnormal exit, status=0, signal=9
[2021-04-11 22:43:23 *2074.35]  NOTICE  end (ERRNO 1005): session[158115] is closed
[2021-04-11 22:43:23 *2075.37]  NOTICE  end (ERRNO 1005): session[158167] is closed
[2021-04-11 22:43:23 *2075.37]  NOTICE  end (ERRNO 1005): session[158172] is closed

What do these notices represent? I couldn't find any correct explanation for them when looking for errors on Google, or in the documentation here in the repository.

Another thing I noticed was when I put the number of Swoole workers to 120 workers, some of the workers simply never processed anything and kept their memory at a fixed value while others didn't stop working at any time. Did I configure something wrong?

Here are some hard workers:

hard-workers

And here are some lazzy workers:

lazy-workers

Why 120 workers? When doing a benchmark test I realized that the cpu usage of my server that has 4 cores did not exceed 2% and the 8GB memory did not exceed 100Mb, this is due to the fact that my request has to wait for the return of the secondary API, I did some calculations and 120 processes would be smooth and there would still be resources on the machine. Correct me if I'm wrong.

The benchmark:

ab -n 100000 -c 50 https://api.digitalocean.com/message

The last thing that occurred to me is that when I try to restart the Supervisor process, the process keeps stopping forever and never ends and I need to restart the server. Should this behavior exist?

supervisor

My supervisor conf:

[program:server-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/server/artisan octane:start --workers=120 --max-requests=1000
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/server/storage/logs/supervisor.log
stopwaitsecs=3600

Server Setup:

Basically I created a server on Digitalocean and followed the same orientation as Sail uses: https://github.com/laravel/sail/lob/1.x/runtimes/8.0/Dockerfile

Then I configured the application and Supervisor.

And my Benchmark route is as follows:

Route::get('message', function () {
    $response = \Illuminate\Support\Facades\Http::post('http://10.136.220.216');

    return $response->successful() ?
        response()->json([
            'message' => 'I successfully send the message.'
        ]) :
        response()->json([
            'message' => 'I was not able to send the message.'
        ], 500);
});

getRequestUri differers

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole
  • Database Driver & Version:

Description:

request()->getRequestUri();
provides different results for serve/php-fpm vs octane swoole/nginx proxy

here is normal artisan serve
image

and here is with swoole
image

as you can see its missing query params

Steps To Reproduce:

return request()->getRequestUri() with query params under normal setup and under swoole octane

[performance] octane high latency underload (compare to laravel-swoole)

  • Octane Version: 0.3
  • Laravel Version: 8.37.0
  • PHP Version: PHP 8.0.3 (cli)
  • Server: Swoole
  • Database Driver & Version: not relevant

Description:

Previously, I'm using laravel-swoole, but decide to stick with octane since it will be first class citizen.
Conducting a small experiment show that, under heavy load octane response time is significantly higher than laravel-swoole (2ms vs 50ms).

Steps To Reproduce:

cd /tmp/
composer create-project laravel/laravel example-app
cd example-app
composer require laravel/octane
php artisan octane:install # choose swoole
composer require swooletw/laravel-swoole
# disable ALL middleware in app/Http/Kernel.php
# add this route to api.php
Route::get('perf', function () {
    return response()->json();
});
# start octane and laravel-swoole
php artisan octane:start --quiet
php artisan swoole:http start
wrk -c4 -t4 -d5 http://127.0.0.1:8000/api/perf # octane
wrk -c4 -t4 -d5 http://127.0.0.1:1215/api/perf # laravel-swoole

Result

Running 5s test @ http://127.0.0.1:8000/api/perf
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    67.29ms  104.33ms 383.10ms   81.59%
    Req/Sec   427.55    351.40     1.02k    59.13%
  6044 requests in 5.01s, 1.23MB read
Requests/sec:   1206.61
Transfer/sec:    252.16KB

Running 5s test @ http://127.0.0.1:1215/api/perf
  4 threads and 4 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.19ms    2.43ms  42.82ms   96.46%
    Req/Sec     1.21k   161.56     2.06k    72.14%
  24208 requests in 5.10s, 4.50MB read
Requests/sec:   4747.04
Transfer/sec:      0.88MB

The result show that underload octane latency go much higher than it rival (that would translate into lower Requests/sec).

Parsing error of upstream time from roadrunner

  • Octane Version: 0.1.1
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole / RoadRunner
  • Database Driver & Version: Mysql 8.0

Description:

When roadrunner outputs upstream time with microseconds (µs) octane server can't parse value and server is falling down

Steps To Reproduce:

  1. Add octane route like this to routes/web.php:
    \Laravel\Octane\Facades\Octane::route('GET', '/test', fn() => new Response('0'));

  2. Run octane with 2 workers
    php artisan octane:start --workers=2 --server=roadrunner

  3. Call this endpoint multiple time (~10-15) and when command parse output with microseconds, server is falling with error

[2021-04-10 20:02:58] local.ERROR: A non-numeric value encountered {"exception":"[object] (ErrorException(code: 0): A non-numeric value encountered at /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php:154)
[stacktrace]
#0 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php(154): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'A non-numeric v...', '/Users/batyrhan...', 154)
#1 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234): Laravel\\Octane\\Commands\\StartRoadRunnerCommand->Laravel\\Octane\\Commands\\{closure}('{\"level\":\"debug...', 1)
#2 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php(163): Illuminate\\Support\\Collection->each(Object(Closure))
#3 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/Concerns/InteractsWithServers.php(48): Laravel\\Octane\\Commands\\StartRoadRunnerCommand->writeServerOutput(Object(Symfony\\Component\\Process\\Process))
#4 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php(85): Laravel\\Octane\\Commands\\StartRoadRunnerCommand->runServer(Object(Symfony\\Component\\Process\\Process), Object(Laravel\\Octane\\RoadRunner\\ServerProcessInspector), 'roadrunner')
#5 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Octane\\Commands\\StartRoadRunnerCommand->handle(Object(Laravel\\Octane\\RoadRunner\\ServerProcessInspector), Object(Laravel\\Octane\\RoadRunner\\ServerStateFile))
#6 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#8 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#9 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#10 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call(Array)
#11 /Users/user/projects/example-app/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArrayInput), Object(Illuminate\\Console\\OutputStyle))
#12 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArrayInput), Object(Illuminate\\Console\\OutputStyle))
#13 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php(68): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArrayInput), Object(Illuminate\\Console\\OutputStyle))
#14 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php(28): Illuminate\\Console\\Command->runCommand('octane:roadrunn...', Array, Object(Illuminate\\Console\\OutputStyle))
#15 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartCommand.php(84): Illuminate\\Console\\Command->call('octane:roadrunn...', Array)
#16 /Users/user/projects/example-app/vendor/laravel/octane/src/Commands/StartCommand.php(50): Laravel\\Octane\\Commands\\StartCommand->startRoadRunnerServer()
#17 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Octane\\Commands\\StartCommand->handle()
#18 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#19 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#20 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#21 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#22 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call(Array)
#23 /Users/user/projects/example-app/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#24 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#25 /Users/user/projects/example-app/vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#26 /Users/user/projects/example-app/vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand(Object(Laravel\\Octane\\Commands\\StartCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#27 /Users/user/projects/example-app/vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#28 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#29 /Users/user/projects/example-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#30 /Users/user/projects/example-app/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#31 {main}
"} 

I suggest replace

https://github.com/laravel/octane/blob/master/src/Commands/StartRoadRunnerCommand.php#L153

$elapsed = Str::endsWith($debug['elapsed'], 'ms')
    ? substr($debug['elapsed'], 0, -2)
    : substr($debug['elapsed'], 0, -1) * 1000;

with something like this:

$elapsed = preg_replace('/[^0-9.]/', '', $debug['elapsed']);

switch (true) {
    case Str::endsWith($debug['elapsed'], 'µs'):
        $elapsed = $elapsed * 0.001;
        break;

    case Str::endsWith($debug['elapsed'], 'ns'):
        $elapsed = $elapsed * 0.00001;
        break;
}

P.S. sorry for my English

unserialize(): Error at offset 10000 of 10000 bytes

  • Octane Version: 0.1.1
  • Laravel Version: 8
  • PHP Version: 8
  • Server: Swoole

Description:

I just changed my default cache driver to octane and i got the following error:

unserialize(): Error at offset 10000 of 10000 bytes#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /app/vendor/laravel/octane/src/Cache/OctaneStore.php(37): unserialize()
#2 /app/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Laravel\Octane\Cache\OctaneStore->get()
#3 /app/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(376): Illuminate\Cache\Repository->get()
#4 /app/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(392): Illuminate\Cache\Repository->remember()
#5 /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Cache\CacheManager->__call()
#8 /app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(234):
#13 [internal function]: Illuminate\Routing\RouteFileRegistrar->{closure}()
#14 /app/vendor/laravel/octane/src/Concerns/ProvidesRouting.php(53): call_user_func()
#15 /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Laravel\Octane\Octane->invokeRoute()
#16 /app/vendor/laravel/octane/src/ApplicationGateway.php(33): Illuminate\Support\Facades\Facade::__callStatic()
#17 /app/vendor/laravel/octane/src/Worker.php(94): Laravel\Octane\ApplicationGateway->handle()
#18 /app/vendor/laravel/octane/bin/swoole-server(119): Laravel\Octane\Worker->handle()
#19 [internal function]: {closure}()
#20 /app/vendor/laravel/octane/bin/swoole-server(169): Swoole\Server->start()
#21 {main}

Looks like it have problem with Eloquent\Collection, if the data is big, it cannot cache it:

Cache::store('octane')->rememberForever('key', fn() => Thread::query()->latest()->take(100)->get());

Octane::concurrently may cause requests to be unresponsive

  • Octane Version: v0.1.1
  • Laravel Version: v8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole
  • Swoole Version: 4.6.5
  • Database Driver & Version: MySQL 5.7.26

Description:

When multiple MySQL queries are launched in Octane:: concurrently, the worker process may not respond.

Steps To Reproduce:

Two tasks can respond normally

I'd like to try to run multiple MySQL queries at the same time, and then use Octane:: concurrently to test. The test code is as follows:

Route::get('/', function () {
    $result = Octane::concurrently([
        function() {
            return DB::select(DB::raw('select sleep(1);'));
        },
        function() {
            return DB::select(DB::raw('select sleep(1);'));
        },
    ]);

    var_dump($result);

    return view('welcome');
});

When requested, two MySQL query tasks are initiated. When I made the request, the server returned normally.

More MySQL queries are unresponsive

Then I increased the number of tasks by one, modified the query statement, and monitored the TaskTerminated event:

Event::listen(TaskTerminated::class, function () {
    echo "Task terminated";
});

Route::get('/', function () {
    $result = Octane::concurrently([
        function() {
            return DB::select(DB::raw('select sleep(1);'));
        },
        function() {
            return DB::select(DB::raw('select sleep(2);'));
        },
        function() {
            return DB::select(DB::raw('select sleep(3);'));
        },
]);

    var_dump($result);

    return view('welcome');
});

But when I started the request, the server didn't respond at all. It was always in the pending state. But you can see that the console outputs three Task terminated.

I used laravel sail to test. I went in and used ps -ef to look at the process status. I found that there are two manager processes, but normally there should be only one.

sail        26    19  0 16:14 ?        00:00:00 swoole_http_server: master process for Laravel
sail        27    26  0 16:14 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        30    27  0 16:14 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        31    27  0 16:14 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        32    27  0 16:14 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        34    27  0 16:14 ?        00:00:00 swoole_http_server: manager process for Laravel

At the same time, the worker process is one less than normal.

Other information

swoole_ http.log shows that the process exited abnormally, and the signal is 9, which should be killed when the maximum execution time is exceeded.

[2021-04-13 16:22:23 $26.0]	WARNING	check_worker_exit_status: worker#1[pid=32] abnormal exit, status=0, signal=9

When using swoole, octane:stop octane:reload can not work normally

  • Octane Version: v0.2.0
  • Laravel Version: v8.37.0
  • PHP Version: 8.0.3
  • Server: Swoole
  • Swoole Version: 4.6.5

Description:

When using swoole, the server started by php artisan octance:start --server=swoole cannot be stopped by octane:stop.

Steps To Reproduce:

  • Start the octane server via sail
./vendor/bin/sail up
  • View server process
./vendor/bin/sail shell
ps -ef
sail        27    20  0 11:44 ?        00:00:00 swoole_http_server: master process for Laravel
sail        28    27  0 11:44 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        31    28  1 11:44 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        32    28  1 11:44 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        33    28  1 11:44 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        34    28  1 11:44 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
  • Stop the server
php artisan octane:stop --server=swoole
  • View process status
ps -ef

The final state:

sail        27    20  0 11:44 ?        00:00:00 swoole_http_server: master process for Laravel
sail        28    27  0 11:44 ?        00:00:00 [php8.0] <defunct>

The php related process has a master process and a zombie process. The zombie process is the previous manager process.

octane:reload

Before reload:

sail        27    20  0 12:18 ?        00:00:00 swoole_http_server: master process for Laravel
sail        28    27  0 12:18 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        31    28  0 12:18 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        32    28  0 12:18 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        33    28  0 12:18 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json
sail        34    28  0 12:18 ?        00:00:00 /usr/bin/php8.0 swoole-server /var/www/html/storage/logs/octane-server-state.json

After reload:

sail        27    20  0 12:18 ?        00:00:00 swoole_http_server: master process for Laravel
sail        28    27  0 12:18 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        52    28  3 12:19 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        53    28  3 12:19 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        54    28  3 12:19 ?        00:00:00 swoole_http_server: manager process for Laravel
sail        55    28  3 12:19 ?        00:00:00 swoole_http_server: manager process for Laravel

After the octane:reload command is executed, the worker process is gone, and a corresponding number of manager processes are generated instead.

Problem with `php://input`

  • Octane Version: 0.1.1
  • Laravel Version: 8
  • PHP Version: 8
  • Server: Swoole

Description:

I want to interact with Telegram API, I have to receive data from telegram hook via php://input, The issue is the file_get_contents always return empty string:

use Symfony\Component\HttpFoundation\Response;

Octane::route('POST', '/hook', function () {
    $data = file_get_contents('php://input');
    
    $url = "https://api.telegram.org/botTOKEN/sendMessage?chat_id=chatId&text=".empty($data) ? 'Empty' : $data;
    
    Http::get($url); // test if we received data but it always says 'Empty'

    return new Response('Ok');
});

But it working with traditional : Route::post(..)

Watching For File Changes Server Reloading Crash

  • Octane Version: 0.1.0
  • Laravel Version: 8.12
  • PHP Version: 8.0.3
  • Database Driver & Version:

Description:

After changes any file Server Crash And Too few arguments to function Laravel\Octane\RoadRunner\ServerProcessInspector::reloadServer(), 0 passed

i figure out the solution octane/src/Commands/Concerns/InteractsWithServers.php on line 54 need to pass any slug.

` while ($server->isRunning()) {
$this->writeServerOutput($server);

            if ($watcher->isRunning() &&
                $watcher->getIncrementalOutput()) {
                $this->info('Application change detected. Restarting workers…');

                $inspector->reloadServer('/');
            }

            usleep(500 * 1000);
        }`

Steps To Reproduce:

Warming up workers when using RoadRunner

This is more of a design question. Is there any particular reason why we cannot move lines 41-49 outside the request handling loop to boot the framework before accepting requests?

$roadRunnerClient = new RoadRunnerClient($psr7Client = new PSR7Worker(
new RoadRunnerWorker(Relay::create('pipes')),
new ServerRequestFactory,
new StreamFactory,
new UploadedFileFactory,
));
$worker = null;
while ($psr7Request = $psr7Client->waitRequest()) {
try {
$worker = $worker ?: tap((new Worker(
new ApplicationFactory($basePath), $roadRunnerClient
)))->boot();
} catch (Throwable $e) {
Stream::shutdown($e);
exit(1);
}
if (! $psr7Request instanceof ServerRequestInterface) {
break;
}
[$request, $context] = $roadRunnerClient->marshalRequest(new RequestContext([
'psr7Request' => $psr7Request
]));
$worker->handle($request, $context);
}
$worker->terminate();

Errors in swoole_http and slow wrk

  • Octane Version: latest
  • Laravel Version: 8.38.0
  • PHP Version: 8.0.3
  • Server: Swoole
  • Database Driver & Version: Clean Install

Description:

I did a clean install, installed octane too and getting this result from wrk.

`wrk -t4 -c50 -d5 http://localhost:8000/

4 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 141.43ms 148.48ms 697.23ms 80.43%
Req/Sec 111.76 78.29 363.00 68.09%
2117 requests in 5.01s, 37.42MB read
Requests/sec: 422.62
Transfer/sec: 7.47MB`

.env:
APP_ENV=production APP_DEBUG=false

swoole_http:
[2021-04-20 15:32:37 *85182.3] NOTICE finish (ERRNO 1004): send 1029 bytes failed, because session#32 is closed [2021-04-20 15:32:37 *85182.3] NOTICE finish (ERRNO 1004): send 17498 bytes failed, because session#32 is closed [2021-04-20 15:32:37 *85182.3] NOTICE finish (ERRNO 1004): send 5 bytes failed, because session#32 is closed [2021-04-20 15:32:37 *85178.2] NOTICE finish (ERRNO 1004): send 1029 bytes failed, because session#19 is closed [2021-04-20 15:32:37 *85178.2] NOTICE finish (ERRNO 1004): send 17498 bytes failed, because session#19 is closed [2021-04-20 15:32:37 *85178.2] NOTICE finish (ERRNO 1004): send 5 bytes failed, because session#19 is closed [2021-04-20 15:32:37 *85182.3] NOTICE finish (ERRNO 1004): send 1029 bytes failed, because session#44 is closed [2021-04-20 15:32:37 *85182.3] NOTICE finish (ERRNO 1004): send 17498 bytes failed, because session#44 is closed ...... like +100 lines like that

Steps To Reproduce:

`__destruct` not being called when binding in controller

  • Octane Version: 0.1.1
  • Laravel Version: 8
  • PHP Version: 8
  • Server: Swoole

In my app i have to bind something inside of controller's method but today i realised when i do this the __destruct never called:

use Illuminate\Support\Facades\App;
use App\Http\Controllers\MyController;
use Symfony\Component\HttpFoundation\Response;

Octane::route('GET', '/index', function () {
    $result = App::make(MyController::class)->index();

    return new Response($result);
});
<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;

class MyController extends Controller
{
    public function index()
    {
        App::bind('foo', fn() => 'bar');

        //
    }

    public function __destruct()
    {
        Log::info('Here');

        // not being called
    }
}

http_plugin_serve_http: cannot enable TCP_DEFER_ACCEPT

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.1
  • PHP Version: 8.0.3
  • Database Driver & Version: none

Description:

i use WSL test octane, but it don't work

Steps To Reproduce:

execute php artisan octane:start:


   INFO  Server running…

  Local: http://127.0.0.1:8000

  Use Ctrl+C to stop the server


   INFO  error occurred: http_plugin_serve_http: cannot enable TCP_DEFER_ACCEPT: protocol not available, plugin: http.Plugin

   ERROR  2021-04-07T10:37:01.292+0800  ERROR   container/poller.go:16  vertex got an error     {"vertex id": "http.Plugin", "error": "http_plugin_serve_http: cannot enable TCP_DEFER_ACCEPT: protocol not available"}

   ERROR  github.com/spiral/endure/pkg/container.(*Endure).poll.func1

   ERROR        github.com/spiral/[email protected]/pkg/container/poller.go:16

   ERROR  handle_serve_command: http_plugin_serve_http: cannot enable TCP_DEFER_ACCEPT: protocol not available; fsm_recognizer: can't transition from state: Stopped by event Stop

Support for SOA ecosystem

I know this is still very early in the development but I'm curious if there are plans to eventually support components necessary for service oriented architecture? Such features are quite common in most frameworks that utilize the underlying techonologies like Swoole. So far the pitch seems to be to simply enable faster laravel applications, but I'm specifically interested in the possibility of adding features like:

  • Service discovery (Consul etc.)
  • RPC
  • Circuit breakers
  • Message queues (Kafka, Perhaps integrated with the underlying event system?)

Is this something that might be within the scope of Octane in the future or should we just assume that if such support is ever integrated, it would be done using 3rd party unofficial packages?

Way to set php.ini values

From looking at octane:start command and bin/swoole-server there does not seem to be a way to set a system php.ini setting that is different than the host machines global php.ini setting. Would a way to provide -dini=value along the lines of php, phpunit binaries be something that could be added?

Failed to open stream: Too many open files in /vendor/composer/ClassLoader.php:478

  • Octane Version: 0.1.0
  • Laravel Version: 8.35.1
  • PHP Version: 8.0.3
  • Database Driver & Version: mysql:5.7 & elasticsearch:7.10.1
  • System:MacOS Big Sur

Description:

wrk -c20 -d5s http://127.0.0.1:8000/api/companies

  200    GET /api/companies ......................................................................................................... 14.77 ms
  200    GET /api/companies ......................................................................................................... 10.31 ms
  200    GET /api/companies ......................................................................................................... 21.90 ms

   ERROR  PHP Fatal error:  Uncaught ErrorException: include(/Users/jonathan/Laravel/m-api/vendor/laravel/octane/src/Events/WorkerErrorOccurred.php): Failed to open stream: Too many open files in /Users/jonathan/Laravel/m-api/vendor/composer/ClassLoader.php:478

  ↑   72 similar errors were reported.

   ERROR  Stack trace:

  ↑   74 similar errors were reported.

   ERROR  #0 /Users/jonathan/Laravel/m-api/vendor/composer/ClassLoader.php(478): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/Users/...', '/Users/jonathan...', 478)

  ↑   74 similar errors were reported.

log is

[2021-04-07 22:28:33 $5548.0]	WARNING	check_worker_exit_status: worker#2[pid=6016] abnormal exit, status=0, signal=9
[2021-04-07 22:28:33 $5548.0]	WARNING	check_worker_exit_status: worker#1[pid=6017] abnormal exit, status=0, signal=9
[2021-04-07 22:28:33 $5548.0]	WARNING	check_worker_exit_status: worker#3[pid=6015] abnormal exit, status=0, signal=9
[2021-04-07 22:28:33 $5548.0]	WARNING	check_worker_exit_status: worker#0[pid=6014] abnormal exit, status=0, signal=9

Steps To Reproduce:

Dynamic route prefixes

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.0
  • PHP Version: 8.0.3
  • Database Driver & Version: Road Runner

Description:

Sorry, this is more a question to clear things up than a bug, but I guess it might help others. It's also an attempt to fix another open source project. I am using https://github.com/mcamara/laravel-localization for our localisation. I am not a maintainer or contributor to that project, but it's pretty popular so I would like to help fix it.

Every translated route I visit in the browser results in a 404. I am pretty sure this needs to be fixed in mcamara/laravel-localization, but I need some help/guidance on how to do this. As not everyone will be familiar with this package, I will explain below.

The package uses a method to load the language prefix in the RouteServiceProvider. The prefix of all routes is loaded with:

Route::prefix(LaravelLocalization::setLocale())

The setLocale function will try to fetch the language from the url. If it doesn't exist, it returns null.

Language prefixes are: en-us, nl-be, as shown in the urls below:

  • en-us/dashboard
  • nl-be/dashboard

I assume the route prefix will be cached, as it is preloaded during initialisation, right? In that case, when it initially loads, the value will be null, as setLocale() won't have a request to parse (so far, all assumptions). That would explain why our translated pages don't work :)

I hope some of you can share some thoughts on what to do.

Steps To Reproduce:

Install mcamara/laravel-localization in a fresh Laravel installation. That's pretty much it.

Thanks for all of the amazing work on Octane by the way. Awesome job!

No default store in cache.php for "octane"

  • Octane Version: 0.1.1
  • Laravel Version: 8.36.2
  • PHP Version: 8.0.3
  • Server: Swoole
  • Database Driver & Version: NA

Description:

There is no default cache store setup for "octane", when trying to access the store the below exception is thrown.

InvalidArgumentException
Cache store [octane] is not defined.

Steps To Reproduce:

Create a new laravel project

composer create-project laravel/laravel octane-test

Require Octane

composer require laravel/octane

Run octane:install

php artisan octane:install

Set config to use Swoole

<?php

use Laravel\Octane\Contracts\OperationTerminated;
use Laravel\Octane\Events\RequestHandled;
use Laravel\Octane\Events\RequestReceived;
use Laravel\Octane\Events\RequestTerminated;
use Laravel\Octane\Events\TaskReceived;
use Laravel\Octane\Events\TickReceived;
use Laravel\Octane\Events\WorkerErrorOccurred;
use Laravel\Octane\Events\WorkerStarting;
use Laravel\Octane\Events\WorkerStopping;
use Laravel\Octane\Listeners\CollectGarbage;
use Laravel\Octane\Listeners\DisconnectFromDatabases;
use Laravel\Octane\Listeners\EnsureUploadedFilesAreValid;
use Laravel\Octane\Listeners\FlushTemporaryContainerInstances;
use Laravel\Octane\Listeners\ReportException;
use Laravel\Octane\Listeners\StopWorkerIfNecessary;
use Laravel\Octane\Octane;

return [

    /*
    |--------------------------------------------------------------------------
    | Octane Server
    |--------------------------------------------------------------------------
    |
    | This value determines the default "server" that will be used by Octane
    | when starting, restarting, or stopping your server via the CLI. You
    | are free to change this to the supported server of your choosing.
    |
    | Supported: "roadrunner", "swoole"
    |
    */

    'server' => env('OCTANE_SERVER', 'swoole'),

Attempt to use the store "octane" as per the README.md

<?php

use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Cache;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    Cache::store('octane')->put('framework', 'Laravel', 30);
});

Option to ignore some watched directories?

During watch mode and when media files are created the server detects the changes and reload the server each time.
would it be a good idea to specify directories to be ignored during watch mode?
so that server don't reload when uncared files changes.

Fresh install with Roadrunner throws `chmod(): No such file or directory` on MacOS M1

  • Octane Version: v0.1.0
  • Laravel Version: 8.36.0
  • PHP Version: 8.0.2
  • Database Driver & Version: No database configured

Description:

I'm trying to install Laravel Octane with Roadrunner. I've not had Roadrunner before. I tried installing the binaries via Octane installation helper itself. It seems to throw the following error:

Fatal error: Uncaught OutOfRangeException: Current architecture (arm64) may not be supported in /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Environment/Architecture/Factory.php:56
Stack trace:
#0 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Environment/Architecture.php(33): Spiral\RoadRunner\Console\Environment\Architecture\Factory->createFromGlobals()
#1 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Command/ArchitectureOption.php(44): Spiral\RoadRunner\Console\Environment\Architecture::createFromGlobals()
#2 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Command/Option.php(56): Spiral\RoadRunner\Console\Command\ArchitectureOption->default()
#3 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Command/Option.php(38): Spiral\RoadRunner\Console\Command\Option->register(Object(Spiral\RoadRunner\Console\GetBinaryCommand), 'arch', 'a')
#4 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Command/ArchitectureOption.php(28): Spiral\RoadRunner\Console\Command\Option->__construct(Object(Spiral\RoadRunner\Console\GetBinaryCommand), 'arch', 'a')
#5 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/GetBinaryCommand.php(72): Spiral\RoadRunner\Console\Command\ArchitectureOption->__construct(Object(Spiral\RoadRunner\Console\GetBinaryCommand))
#6 /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/bin/rr(69): Spiral\RoadRunner\Console\GetBinaryCommand->__construct()
#7 {main}
  thrown in /Users/shahlinibrahim/Projects/Test/OctaneTest/vendor/spiral/roadrunner-cli/src/Environment/Architecture/Factory.php on line 56


 ErrorException 

 chmod(): No such file or directory

Steps To Reproduce:

  1. Set roadrunner as the server in config/octane.php
  2. Run php artisan octane:start
  3. When it prompts you to install Roadrunner, type yes.
  4. It prompts you to install the binaries, type yes.
  5. Above error shows up

Server reloads unnecessarily when linked files to public dir changes

  • Octane Version: 0.2.0
  • Laravel Version: ^8.37
  • PHP Version: 8.0.2
  • Server: Swoole

Description:

based on the previously closed issue #118

During watch mode and when media files are created the server detects the changes and reload the server each time.
would it be a good idea to specify directories to be ignored during watch mode?
so that server don't reload when uncared files changes.

and later comment #118 (comment)

This pull request didn't solve the unnecessary server reload issue.

For example i have linked some folders into the public dir (public/images)
when new images are added the watcher detects changes from public/images dir and reloads the server.

With the pull request created there is still no option to ignore some nested folders.

I will try to make a pull request for unwatch config.

i hope the pull request will be considered.

Tried a pull request #201
but unfortunately it was closed with no clear reason.

I hope someone can see this issue and try to solve it.

I have tried and my effort have not been considered.

Runtime Exception: Unable to write to process ID file. (Swoole + Docker)

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.0
  • PHP Version: 8.0.3
  • Database Driver & Version: PostgreSQL (libpq) Version => 13.2

Description:

Running a docker container, running laravel octane as root, shouldn't have permission issues.

  RuntimeException 

  Unable to write to process ID file.

  at vendor/laravel/octane/src/Swoole/ServerStateFile.php:62
     58▕      */
     59▕     public function writeState(array $newState): void
     60▕     {
     61▕         if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {
  ➜  62▕             throw new RuntimeException('Unable to write to process ID file.');
     63▕         }
     64▕ 
     65▕         file_put_contents($this->path, json_encode(
     66▕             array_merge($this->read(), ['state' => $newState]),

      +27 vendor frames 
  28  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Steps To Reproduce:

  • Try to run octane in a docker container. (ENTRYPOINT ['php', 'artisan', 'octane:start'])

Dockerfile to reproduce

FROM php:latest
RUN apt-get update && apt-get upgrade -y && apt-get install git -y
COPY ./ /app/
WORKDIR /app

# Install Extensions (Swoole)
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync
RUN install-php-extensions swoole

# Install Source Code Dependencies
ADD https://getcomposer.org/composer-stable.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer
RUN composer install

# Open Ports
EXPOSE 8000

# Entrypoint
ENTRYPOINT ["php", "artisan", "octane:start", "--host=0.0.0.0"]

Laravel Nova Navigation is duplicating itself

  • Octane Version: 0.1.0
  • Laravel Version: 8.36.0
  • Laravel Nova 3.22.0
  • PHP Version: 8.0.3
  • Ubuntu 20.10

Description:

The navigation panel gets duplicated on page refresh.

Steps To Reproduce:

Please see the video below

video.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.