fix: FrankenPHP fallback to chokidar on poll#1098
fix: FrankenPHP fallback to chokidar on poll#1098AlliBalliBaba wants to merge 6 commits intolaravel:2.xfrom
Conversation
|
@AlliBalliBaba I think It should install chokidar too right? tried |
|
Yeah with the default watcher you sadly need node and chokidar installed as well. Something like: sudo apt install -y nodejs
sudo npm install -g chokidar |
|
@AlliBalliBaba ok it's working for now but there are some issues here:
About the first one I think it is possible to add |
|
If you are updating env variables that affect the octane process itself you might have to completely restart manually. Watching will only restart the workers, not the |
|
well tried to change |
This is expected behaviour and means the polling works. The watcher will restart on any change to
If you care about performance, I'd still recommend moving the project inside of WSL, which will be much faster overall. You'll have to properly set up your IDE though. Windows is just really slow with file access.
That seems like a bug independent from this PR. If you decide to move into WSL, you can also try running FrankenPHP directly, without # replace /path/to/laravel with the absolute path to the Laravel project
# replace /path/to/Caddyfile with the path to the Caddyfile below
APP_BASE_PATH=/path/to/laravel frankenphp run -c /path/to/CaddyfileCaddyfile example: {
# https://caddyserver.com/docs/caddyfile
# https://frankenphp.dev/docs/config
admin localhost:2019
frankenphp {
php_ini {
max_execution_time 30 # you can add more php.ini settings here
}
}
}
:80 { # running on HTTP port 80
route {
encode zstd br gzip # enable compression
php_server {
root {$APP_BASE_PATH}/public # public path of laravel
worker {
file "{$APP_BASE_PATH}/vendor/laravel/octane/bin/frankenphp-worker.php"
num 4 # initial threads, roughly number of CPU cores, can also be higher
max_threads 20 # maximum of threads, roughly 5x CPU cores, can also be higher
match * # send all requests to this worker
watch {$APP_BASE_PATH} # watcher enabled
}
}
}
} |
Fixes #1034
FrankenPHP's built in watcher does not support polling. If --poll is passed, the watcher should fallback to chokidar. This fixes setups where the repo might be in a mount like the windows mount on wsl.
@IranMine123 can you try if this branch makes
--watch --pollwork for you on WSL?