# 常见问题

# composer install安装出错

  • 可以通过composer update修复,也可直接将composer.lock删除,然后再执行composer install

# Client error: POST http://127.1.1/oauth/token resulted in a 401 Unauthorized response: {"error":"invalid_client","message":"Client authentication failed"}

  • 以上错误推测因为生成oauth密钥过早造成,故新的文档最后才生成该密钥
  • 解决办法就是先删除已经生成的oauth-private.keyoauth-public.key,然后再重新执行php artisan passport:keys
  • 如果是主从数据库的话,请检查是否有同步

# Server error: POST http://dswjcms.test/oauth/token resulted in a 500 Internal Server Error response:\n{"status_code":500,"code":10,"message":"The provided authorization grant (e.g., authorization code, resource owner crede (truncated...)\n

  • php artisan passport:client --password步骤时,未选择admins超成的错误,可修改oauth_clients表,将provider改成admins

# [curl] 7: Failed to connect to xxx port 80: Connection refused

  • 由于laradock没有正确配置造成的错误
  • 需要修改docker-compose.yml的NGINX Server中的networks部分,如下代码,在aliasesaliases添加自己的域名,如下dsshop.test
### NGINX Server ##################################

    nginx:
      build:
        context: ./nginx
        args:
          - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
          - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
      volumes_from:
        - applications
      volumes:
        - ${NGINX_HOST_LOG_PATH}:/var/log/nginx
        - ${NGINX_SITES_PATH}:/etc/nginx/sites-available
      ports:
        - "${NGINX_HOST_HTTP_PORT}:80"
        - "${NGINX_HOST_HTTPS_PORT}:443"
      depends_on:
        - php-fpm
      networks:
        frontend:
         aliases:
          - dsshop.test
        backend:
         aliases:
          - dsshop.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# 商品搜一个字为什么无法查询出来?

# laradock备份报Backup failed because The dump process failed with exitcode 127 : Command not found : sh: 1: mysqldump: not found

  • 打开你的workspace/Dockerfile最后一行添加以下代码
#
#--------------------------------------------------------------------------
# mysql-client
#--------------------------------------------------------------------------
#

USER root

RUN apt update && \
    apt install -y mysql-client
1
2
3
4
5
6
7
8
9
10
  • 然后执行以下代码
docker-compose down
docker-compose build workspace
docker-compose up -d redis nginx mysql
1
2
3

# 网站、后台记住密码一般是保存几天,如何设置

  • 默认为7天,可通过env配置REFRESH_PASSPORT_EXPIRES_IN

# 网站、后台记住密码,关闭浏览器后并没有生效

  • 请查看浏览器是否关闭浏览器清除cookie功能,设置->隐私设置和安全设置->Cookie及其它网络安全设置