worker.php 1.8 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | Workerman设置 仅对 php think worker 指令有效
  13. // +----------------------------------------------------------------------
  14. return [
  15. // 扩展自身需要的配置
  16. 'host' => '0.0.0.0', // 监听地址
  17. 'port' => 2349, // 监听端口
  18. 'root' => '', // WEB 根目录 默认会定位public目录
  19. 'app_path' =>"", // 应用目录 守护进程模式必须设置(绝对路径)
  20. // 'app_path' =>__DIR__."/../".env("worker","app".DIRECTORY_SEPARATOR."worker".DIRECTORY_SEPARATOR."worker"), // 应用目录 守护进程模式必须设置(绝对路径)
  21. 'file_monitor' => false, // 是否开启PHP文件更改监控(调试模式下自动开启)
  22. 'file_monitor_interval' => 2, // 文件监控检测时间间隔(秒)
  23. 'file_monitor_path' => [
  24. \app\worker\controller\Worker::class
  25. ], // 文件监控目录 默认监控application和config目录
  26. // 支持workerman的所有配置参数
  27. 'name' => 'thinkphp',
  28. 'count' => 1,
  29. 'daemonize' => false,
  30. 'pidFile' => '',
  31. ];