【问题标题】:How can i setup Drush to use a proxy server to access internet on Windows7?如何在 Windows 7 上设置 Drush 以使用代理服务器访问 Internet?
【发布时间】:2013-02-26 14:39:35
【问题描述】:

我正在使用 WAMP 进行 Drupal 开发。我已经安装了 drush,它在没有任何代理的情况下使用家庭网络时工作正常。当我在工作时,网络设置使用代理来访问互联网,因此任何需要互联网的 drush 命令,例如。 drush dl {module_name},不起作用。

谷歌搜索后,我只能找到告诉我如何在基于 *nix 的操作系统上配置它们的文本。我被windows7卡住了。有什么想法吗?

【问题讨论】:

    标签: drupal windows-7 proxy wamp drush


    【解决方案1】:

    好的。我让它运行起来。我必须进行以下更改才能使 drush dl 在 Windows 7 上工作。显然“which wget”没有返回任何内容,因为 Windows 没有“which”命令。我破解了 drush 核心以进行以下更改。

    1. 转到文件夹 C:\ProgramData\Drush\includes 中的文件 drush.inc
    2. 更改行 $use_wget = drush_shell_exec('which wget'); with $use_wget = drush_shell_exec('where wget');

    根本原因:Windows 没有“which”命令,“where”命令起作用

    我认为代理根本没有问题,它正确使用了 drupal 的 settings.php 文件中的代理

    【讨论】:

    • 如果 drush 无法从 Internet 下载任何内容,请尝试通过在 C:\Program Files (x86)\Drush\GnuWin32\etc 文件夹中的 wgetrc 文件中添加此行来修复代理。 http_proxy = http://proxy.server.name:port_number
    猜你喜欢
    • 1970-01-01
    • 2015-02-11
    • 2013-10-09
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-09
    相关资源
    最近更新 更多