laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.71k stars 284 forks source link

Error starting octane server swoole #844

Closed avlima closed 4 months ago

avlima commented 4 months ago

Octane Version

2.3.4

Laravel Version

10.46.0

PHP Version

8.2.11

What server type are you using?

Swoole

Server Version

5.0.3

Database Driver & Version

Postgres 14

Description

I get the following error:

PHP Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found in /Users/alberto/Projects/ThinkOutside/rejux-back/vendor/laravel/octane/src/Stream.php:56
Stacktrace:
#0 /Users/alberto/Projects/ThinkOutside/rejux-back/vendor/laravel/octane/bin/createSwooleServer.php(19): Laravel\Octane\Stream::shutdown(Object(Swoole\Exception))
#1 /Users/alberto/Projects/ThinkOutside/rejux-back/vendor/laravel/octane/bin/swoole-server(35): require('/Users/alberto/...')
#2 {main}
  thrown in /Users/alberto/Projects/ThinkOutside/rejux-back/vendor/laravel/octane/src/Stream.php on line 56
Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found in /Users/alberto/Projects/ThinkOutside/rejux-back/vendor/laravel/octane/src/Stream.php:56

This is after updating the Octane version 2.3.2 to the latest 2.3.4, in order to solve other problems that are worth a new issue, but I will also give a brief explanation:

I noticed that in lower versions of octane there was security using JWT token, but in version 2.3.2 I am facing a problem with a security flaw.

When generating the token, I do not need to send it in the authorization Bearer header....

Even though the routes are in the auth:api middleware, they return data without passing the Bearer token.

Testing in other applications with older versions of octane, we do not have this problem.

Steps To Reproduce

When starting the server with the command:

php artisan octane:start --server=swoole --host=0.0.0.0 --max-requests=3000 --workers=4 --task-workers=12 --port=8089
avlima commented 4 months ago

I updated an older application to the latest version of octane and it did not show the error. I will close my issue until I can better identify what happened.