dpw63348 2019-07-30 20:52
浏览 1340

如何解决Laravel / Lumen应用中的'cURL错误6:无法解析主机'

I need to figure out why I'm getting a 504 error when trying to connect to the dev server in my Lumen app. The problem started after upgrading to a new computer with MacOS Mojave 10.14.

I'm using php7.3, MySQL and Homestead as the DB, React.js for the front end. The app uses microservices that are all attached to a backend API gateway.

I'm at a loss and I think I just need some perspective on why the error is occurring. If someone could try to walk me through it as simple as possible it would help a lot.

My assumption is that it has to do with my .env config.

I've tried

  • Reinstalling PHP (currently using php7.3 installed by homebrew)
  • Using different MySQL database
  • Starting server directly from Homestead (currently Ubuntu 14 VM with virtualbox)
  • Re-installing apache2 server (Mojave problem - may not be related)
  • Changing .env config variables
  • Restarting/changing DNS server
  • Updating /etc/hosts file
  • Increasing gateway timeout in php.ini
  • Turning it off and turning it on...

My .env file looks like this:

APP_NAME=Lumen
APP_ENV=local
APP_KEY=tHd56UgN634EWSDeRYyy5634REr35T67
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC

LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mms
DB_USERNAME=aaron
DB_PASSWORD=mangobyte

CACHE_DRIVER=file
QUEUE_CONNECTION=sync

X_MMS_SERVICE_KEYS=iUiWsTfI63ODGAHtqb1Guf05IQcGe3mI

API_PREFIX=v1/

When I start the dev servers for both the API and React, I am able to reach the Login page with a [200] code status, but when I log in with the Admin credentials (seeded into Homestead DB using Faker), I get a [504] status.

From the Lumen .log file:

local.ERROR: GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: v1 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /Users/aaronalt/mango/mms/mms_gateway_back_source/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185

I'm curious if it's not communicating with the database in order to receive or verify the login credentials?

Thanks very much!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行