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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?