安装laravels发现的问题

安装命令

composer require "hhxsv5/laravel-s:~3.5.0" -vvv

遇到问题

[root@lsujkgpy1c Laravel]# php artisan laravels publish


Command "laravels" is not defined.

需要配置config/app.php

'providers' => [
    Hhxsv5\LaravelS\Illuminate\LaravelSServiceProvider::class,
],
配置后问题解决

[root@lsujkgpy1c Laravel]# php artisan laravels publish
Copied file [/docker/www/Laravel/vendor/hhxsv5/laravel-s/config/laravels.php] To [/docker/www/Laravel/config/laravels.php]
Linked file [/docker/www/Laravel/vendor/hhxsv5/laravel-s/bin/laravels] To [/docker/www/Laravel/bin/laravels]
Linked file [/docker/www/Laravel/vendor/hhxsv5/laravel-s/bin/fswatch] To [/docker/www/Laravel/bin/fswatch]
Linked file [/docker/www/Laravel/vendor/hhxsv5/laravel-s/bin/inotify] To [/docker/www/Laravel/bin/inotify]

配置.env

LARAVELS_LISTEN_IP=0.0.0.0
LARAVELS_LISTEN_PORT=5200
LARAVELS_WORKER_NUM=4

 配置nginx反向代理

upstream swoole {
  server 172.17.0.3:5200 weight=5 max_fails=3 fail_timeout=30s;
  keepalive 16; }
server {
  listen 80;
  listen [::]:80;
  server_name localhost;
  root /docker/www/lmrs-2008/public;
  index index.php index.html;
  location / {
    try_files $uri @laravels;
  }

  location @laravels {
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header Scheme $scheme;
    proxy_set_header Server-Protocol $server_protocol;
    proxy_set_header Server-Name $server_name;
    proxy_set_header Server-Addr $server_addr;
    proxy_set_header Server-Port $server_port;
    proxy_pass http://swoole;
  }
}

测试遇到的坑:访问laravel项目出现502

找问题:

原因是未开启laravels,开启一下bin/laravels start -d 问题解决

posted @ 2021-11-27 00:27  `奔跑的蜗牛  阅读(134)  评论(0编辑  收藏  举报