您现在的位置是:首页 >技术交流 >windows下编译roadrunner和作为laravel服务器实践网站首页技术交流

windows下编译roadrunner和作为laravel服务器实践

梅坞茶坊 2024-08-08 12:01:03
简介windows下编译roadrunner和作为laravel服务器实践

roadrunner源码地址:https://gitee.com/mirrors/RoadRunner?_from=gitee_search

windows下编译roadrunner源码获得rr.exe可执行文件

将rr.exe拷贝到laravel目录下

.rr.yaml配置文件内容:

version: '3'

server:
  command: "php vendor/spiral/roadrunner-laravel/bin/rr-worker start"

http:
  address: 0.0.0.0:8080
  middleware: ["static", "headers", "gzip"]
  pool:
    #max_jobs: 64 # feel free to change this
    supervisor:
      exec_ttl: 60s
  headers:
    response:
      X-Powered-By: "RoadRunner"
  static:
    dir: "public"
    forbid: [".php"]

laravel框架安装roadrunner-laravel桥:

composer require spiral/roadrunner-laravel

安装完毕进入命令行就可以启动服务了:

 

linux下可以后台启动:

rr -c ./.rr.yaml serve -d

风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。