• <bdo id='ZUZPM'></bdo><ul id='ZUZPM'></ul>
  • <tfoot id='ZUZPM'></tfoot>

      <small id='ZUZPM'></small><noframes id='ZUZPM'>

      <i id='ZUZPM'><tr id='ZUZPM'><dt id='ZUZPM'><q id='ZUZPM'><span id='ZUZPM'><b id='ZUZPM'><form id='ZUZPM'><ins id='ZUZPM'></ins><ul id='ZUZPM'></ul><sub id='ZUZPM'></sub></form><legend id='ZUZPM'></legend><bdo id='ZUZPM'><pre id='ZUZPM'><center id='ZUZPM'></center></pre></bdo></b><th id='ZUZPM'></th></span></q></dt></tr></i><div id='ZUZPM'><tfoot id='ZUZPM'></tfoot><dl id='ZUZPM'><fieldset id='ZUZPM'></fieldset></dl></div>

      1. <legend id='ZUZPM'><style id='ZUZPM'><dir id='ZUZPM'><q id='ZUZPM'></q></dir></style></legend>

        WAMP Laravel - 将 API 请求从一个本地站点发送到另一个站点会混淆环境变量

        WAMP Laravel - Sending API requests from one local site to another mixes up environment variables(WAMP Laravel - 将 API 请求从一个本地站点发送到另一个站点会混淆环境变量)
          <tbody id='xYqAW'></tbody>

            <i id='xYqAW'><tr id='xYqAW'><dt id='xYqAW'><q id='xYqAW'><span id='xYqAW'><b id='xYqAW'><form id='xYqAW'><ins id='xYqAW'></ins><ul id='xYqAW'></ul><sub id='xYqAW'></sub></form><legend id='xYqAW'></legend><bdo id='xYqAW'><pre id='xYqAW'><center id='xYqAW'></center></pre></bdo></b><th id='xYqAW'></th></span></q></dt></tr></i><div id='xYqAW'><tfoot id='xYqAW'></tfoot><dl id='xYqAW'><fieldset id='xYqAW'></fieldset></dl></div>
            <tfoot id='xYqAW'></tfoot>

            <small id='xYqAW'></small><noframes id='xYqAW'>

            <legend id='xYqAW'><style id='xYqAW'><dir id='xYqAW'><q id='xYqAW'></q></dir></style></legend>

                • <bdo id='xYqAW'></bdo><ul id='xYqAW'></ul>

                • 本文介绍了WAMP Laravel - 将 API 请求从一个本地站点发送到另一个站点会混淆环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发我开发的另一个网站将使用的 API 服务.因此,在本地构建和测试时,显然我希望站点的两个本地副本都能正常工作.但是,它似乎混淆了 environment 变量.

                  I am developing an API service that another site I've developed will be using. So locally when building and testing, obviously I want both local copies of the site to work. However, it seems to mix up the environment variables.

                  例如:

                  • 站点 AAPP_URL=http://a.local
                  • 站点 BAPP_URL=http://b.local
                  • 我从 Site A 代码向 http://b.local/test 发送 GET 请求(使用 Guzzle)
                  • Site B 中的 /test 端点只是简单地转储出 dump(env('APP_URL'))
                  • Site A 检索到的结果是 "http://a.local"
                  • 预期结果:http://b.local"
                  • Site A has APP_URL=http://a.local
                  • Site B has APP_URL=http://b.local
                  • I send a GET Request (using Guzzle) from Site A code to http://b.local/test
                  • The /test endpoing in Site B simply dumps out dump(env('APP_URL'))
                  • Result retrieved by Site A is "http://a.local"
                  • Expected result: "http://b.local"

                  所以 Site B 中的代码使用从 Site A 加载的环境变量运行.这是一个问题,因为 Site B 无法访问正确的数据库,它正在尝试使用 Site A 的数据库.

                  So the code in Site B is running with environment variables loaded from Site A. This is an issue as Site B cannot access the correct database, it's trying to use the Site A's database.

                  这是我的本地设置(Win10 + WAMP)、PHP 设置、Laravel 设置的问题吗?

                  Is this an issue with my local setup (Win10 + WAMP), PHP settings, Laravel settings?

                  推荐答案

                  我也遇到了这个问题,提到了这里.它的解决方案是在两个项目中运行 php artisan config:cache 以缓存 .env 文件中的配置或修补 这里.

                  I also encountered this issue, and it is mentioned here. The resolution for it is to run php artisan config:cache in both projects to cache configuration from .env files or patch the code from here.

                  这篇关于WAMP Laravel - 将 API 请求从一个本地站点发送到另一个站点会混淆环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <small id='p1WTH'></small><noframes id='p1WTH'>

                  • <bdo id='p1WTH'></bdo><ul id='p1WTH'></ul>

                          • <i id='p1WTH'><tr id='p1WTH'><dt id='p1WTH'><q id='p1WTH'><span id='p1WTH'><b id='p1WTH'><form id='p1WTH'><ins id='p1WTH'></ins><ul id='p1WTH'></ul><sub id='p1WTH'></sub></form><legend id='p1WTH'></legend><bdo id='p1WTH'><pre id='p1WTH'><center id='p1WTH'></center></pre></bdo></b><th id='p1WTH'></th></span></q></dt></tr></i><div id='p1WTH'><tfoot id='p1WTH'></tfoot><dl id='p1WTH'><fieldset id='p1WTH'></fieldset></dl></div>
                              <tbody id='p1WTH'></tbody>
                            <tfoot id='p1WTH'></tfoot>

                            <legend id='p1WTH'><style id='p1WTH'><dir id='p1WTH'><q id='p1WTH'></q></dir></style></legend>