我尝试了几种方法来为我的本地Drupal项目创建别名,我参考了以下链接:https://www.drupal.org/node/1401522, https://www.drupal.org/project/drush/issues/831272, https://www.drupal.org/project/drush/issues/786766。我可以通过运行此命令连接:
drush --root=C:/wamp64/www/executive-coatings --uri=http://localhost:81/executive-coatings status
输出:
Drupal version : 8.6.13
Site URI : http://localhost:81/executive-coatings
DB driver : mysql
DB hostname : localhost
DB port : 3306
DB username : root
DB name : dev_ecc_new
Database : Connected
Drupal bootstrap : Successful
Default theme : ecc_front
Admin theme : adminimal_theme
PHP binary : C:\wamp64\bin\php\php7.2.10\php.exe
PHP config : C:\wamp64\bin\php\php7.2.10\php.ini
PHP OS : WINNT
Drush script : C:\wamp64\www\executive-coatings\vendor\bin\drush.phar
Drush version : 9.6.2
Drush temp : C:\Users\k\AppData\Local\Temp
Drush configs : C:/Users/k/.drush/drush.yml
C:/wamp64/www/executive-coatings/vendor/drush/drush/drush.yml
Install profile : minimal
Drupal root : C:\wamp64\www\executive-coatings
Site path : sites/default
Files, Public : sites/default/files
Files, Temp : /tmp
然而,当我尝试使用drush别名时,它无法正常工作。以下是我的别名文件:
$aliases['local'] = array(
'uri' => 'localhost:81/executive-coatings',
'root' => 'C:/wamp64/www/executive-coatings',
'path-aliases' => array(
'%dump-dir' => '/tmp',
),
);
运行 drush @local status
返回 [preflight] 找不到别名@local。
我认为我将别名文件放在了错误的目录中,请问您能提供正确的路径吗?
Drush版本:9.6.2
。然而这有些令人困惑,因为Drush和Drupal的版本不相关,请参见https://docs.drush.org/en/master/install/#drupal-compatibility。 - EricLavault