drxpt06820 2014-10-07 00:46
浏览 71

Drush + Cygwin PHP致命错误

I have had to re-install / update Cygwin on Windows 8.1, and I have some how broken Drush on my Drupal 7 sites.

Previously I followed this guide Here So I have tried to do a clean install of drush, and noticed that you can now install drush via pear.

pear channel-discover pear.drush.org
pear install drush/drush

So in my home directory :

$ drush --version
 Drush Version   :  6.2.0

That seems to work, but when I go into my directory where my Drupal web site is, I am getting PHP fatal errors, it is like the PATH or something is broken when I run drush from there :

$ cd /cygdrive/c/websites/www.mywebsite.com
$ drush
require_once(c:/websites/www.mywebsite.com/modules/system/system.module): failed to open stream: No such file or directory drupal.inc:21           [warning]
PHP Fatal error:  require_once(): Failed opening required 'c:/websites/www.mywebsite.com/modules/system/system.module' (include_path='.:/usr/share/pear') in /usr/share/pear/drush/includes/drupal.inc on line 21
require_once(c:/websites/www.mywebsite.com/modules/system/system.module): failed to open stream: No such file or directory drupal.inc:21           [warning]
PHP Fatal error:  require_once(): Failed opening required 'c:/websites/www.mywebsite.com/modules/system/system.module' (include_path='.:/usr/share/pear') in /usr/share/pear/drush/includes/drupal.inc on line 21

My Current set up is :

  • Windows 8.1
  • Cygwin
  • Drupal 7
  • For PHP I am using WAMP, but PHP is working in Cygwin

.

$ php -v
PHP 5.5.16 (cli) (built: Aug 24 2014 01:12:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
  • 写回答

1条回答 默认 最新

  • douchun1948 2015-10-20 00:40
    关注

    When using Cygwin's version of PHP, the "require" statement does not recognize path names which start with a drive letter. Thus require 'C:\path-to-file' will generally fail. Internally, it sees the 'C:' as a relative path and appends it to the default directory rather than treating it as an absolute path.

    If you rewrite the require statements to use __DIR__, then things usually work.

    require __DIR__ . '/modules/system/system.module';

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器