Support the ongoing development of Laravel.io →
Laravel Octane

Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found when using --watch

Octane Version 2.3.2

Laravel Version 10.43.0

PHP Version 8.1

What server type are you using? Swoole

Server Version latest

Database Driver & Version No response

Description Issue Description:

When running Laravel Octane with the --watch option, the following error occurs:
only when --watch used in supervisor config of octane, i have below error, otherwise without --watch there is no error.
also without supervisor, when i run command octane start manually, have error when using --watch

Error Message:

  | 2024-01-31 13:20:36,205 WARN exited: octane_00 (exit status 255; not expected)
  | 2024-01-31 13:20:37,211 INFO spawned: 'octane_00' with pid 981
  | 2024-01-31 13:20:38,235 INFO success: octane_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  | 
  |    INFO  Server running…
  | 
  |   Local: http://0.0.0.0:8000 
  | 
  |   Press Ctrl+C to stop the server
  | 
  | Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found in /var/www/html/vendor/laravel/octane/src/Stream.php:57
  | Stack trace:
  | #0 /var/www/html/vendor/laravel/octane/bin/createSwooleServer.php(19): Laravel\Octane\Stream::shutdown(Object(Swoole\Exception))
  | #1 /var/www/html/vendor/laravel/octane/bin/swoole-server(35): require('/var/www/html/v...')
  | #2 {main}
  |   thrown in /var/www/html/vendor/laravel/octane/src/Stream.php on line 57

Supervisor Config:

[supervisord]
logfile=/var/log/supervisord_octane.log
logfile_maxbytes=40MB
logfile_backups=5
loglevel=info
pidfile=/var/run/supervisord_octane.pid
nodaemon=true
minfds=1024
minprocs=200
user=root

[program:octane]
process_name=%(program_name)s_%(process_num)02d
command=php -d variables_order=EGPCS /var/www/html/artisan octane:start --watch --server=swoole --host=0.0.0.0 --port=8000 --workers=20 --task-workers=auto --max-requests=2000
user=root
autostart=true
autorestart=true
environment=LARAVEL_OCTANE="1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
numprocs=1

composer dump autoload and artisan cache clear not worked

Last updated by @tvbeek 1 year ago.
0
moderator

Hello @amirali-bagheri

Did you check the requirements for the watch option? (See documentation: https://laravel.com/docs/10.x/octane#watching-for-file-changes )

Maybe I miss understood it but what is the reason to use the watch option in combination with the supervisor? I should expect to only use the watch option during development but I personal don't use octane so maybe I'm missing something and are interested :)

Ps. I have updated your post to get the blocks with text.

Last updated by @tvbeek 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.