安装laravel
composer create-project --prefer-dist laravel/laravel blog
cd blog
php artisan serve
roadrunner替代PHP-FPM
https://roadrunner.dev/
下载:https://github.com/spiral/roadrunner/releases
连接roadrunner和laravel
https://roadrunner.dev/docs/integration-laravel
一共3个连接器,选择了第一个
https://github.com/spiral/roadrunner-laravel
#安装连接器
composer require spiral/roadrunner-laravel "^3.4"
#生成配置文件
php ./artisan vendor:publish --provider='Spiral\RoadRunnerLaravel\ServiceProvider' --tag=rr-config
最小配置文件.rr.yaml
env:
#APP_REFRESH: true
http:
address: 0.0.0.0:8080
workers:
command: 'php ./vendor/bin/rr-worker'
static:
dir: 'public'
启动
rr -c ./.rr.yaml serve -d