Я выполнил инструкции по http://docs.drush.org/en/master/install/ для установки Drush (попробовал как глобальные, так и отдельные параметры).Drush не работает с ReflectionException: класс Drush Sql Sql7 не имеет конструктора
Когда я кд к корню сайта Drupal и типа «статус Drush» я получаю следующее:
Drupal version : 7.34
Site URI : http://default
PHP executable : /usr/bin/php
PHP configuration : /etc/php.ini
PHP OS : Linux
Drush script : /root/.composer/vendor/drush/drush/drush.php
Drush version : 7.0.0
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /var/www/site_dev
Site path : sites/default
Когда я типа «Drush куб.см все» я получаю:
No Drupal site found, only 'drush' cache was cleared.
'all' cache was cleared.
Когда я типа «Drush sqlc» я получаю:
exception 'ReflectionException' with message 'Class Drush\Sql\Sql7 does not have a constructor, so you cannot pass any constructor [error]
arguments' in /root/.composer/vendor/drush/drush/includes/drush.inc:113
Stack trace:
#0 /root/.composer/vendor/drush/drush/includes/drush.inc(113): ReflectionClass->newInstanceArgs(Array)
#1 /root/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(605): drush_get_class('Drush\Sql\Sql', Array, Array)
#2 /root/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(588): drush_sql_get_version()
#3 /root/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(454): drush_sql_get_class()
#4 [internal function]: drush_sql_cli()
#5 /root/.composer/vendor/drush/drush/includes/command.inc(368): call_user_func_array('drush_sql_cli', Array)
#6 /root/.composer/vendor/drush/drush/includes/command.inc(219): _drush_invoke_hooks(Array, Array)
#7 [internal function]: drush_command()
#8 /root/.composer/vendor/drush/drush/includes/command.inc(187): call_user_func_array('drush_command', Array)
#9 /root/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#10 /root/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /root/.composer/vendor/drush/drush/drush.php(11): drush_main()
#12 {main}
Это меня поражает, что эта проблема имеет что-то делать с MySQL (поскольку статус Безразлично» t перечислить параметры БД), но я не могу понять это. На сайтах есть только папка по умолчанию, поэтому она не является многопользовательской установкой.
Может кто-нибудь сообщить, что случилось, пожалуйста?
UPDATE Я обновил PHP до версии 5.5.27 и переустановил Drush 7.0.0. После совет here я удалил my.cnf из домашней папки и после этого «Drush sqlc» начал работать, но когда я типа «Drush -v -d статус» он дает мне:
Starting Drush preflight. [0.01 sec, 2.08 MB] [preflight]
Cache HIT cid: 7.0.0-commandfiles-0-81cc86c1995ab7206f383ec28ad43baf [0.01 sec, 2.14 MB] [debug]
Bootstrap to phase 0. [0.07 sec, 6.08 MB] [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.08 sec, 6.43 MB] [bootstrap]
Initialized Drupal 7.34 root directory at /var/www/site_dev [0.08 sec, 6.43 MB] [notice]
Find command files for phase 1 (max=7) [0.08 sec, 4.48 MB] [debug]
Cache HIT cid: 7.0.0-commandfiles-1-a0882f4af91e1d6b72794cc62bb1b558 [0.08 sec, 4.49 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_site() [0.08 sec, 4.49 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.08 sec, 4.5 MB] [notice]
Find command files for phase 2 (max=7) [0.09 sec, 4.5 MB] [debug]
Cache HIT cid: 7.0.0-commandfiles-2-f17fc6bdab2f74278df75194ca483893 [0.09 sec, 4.5 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.09 sec, 4.5 MB] [bootstrap]
Find command files for phase 3 (max=7) [0.09 sec, 4.51 MB] [debug]
sql-query: SELECT 1; [0.09 sec, 4.62 MB] [status]
Executing: mysql --defaults-extra-file=/tmp/drush_CKiVHd --database=site_dev --host=localhost --silent < /tmp/drush_DG1fIs
1
Drush bootstrap phase : bootstrap_drupal_database() [0.1 sec, 4.62 MB] [bootstrap]
Successfully connected to the Drupal database. [0.11 sec, 5.13 MB] [bootstrap]
Find command files for phase 4 (max=7) [0.11 sec, 5.13 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_full() [0.11 sec, 5.13 MB] [bootstrap]
Cannot modify header information - headers already sent by (output started at /root/.composer/vendor/drush/drush/includes/output.inc:38)[warning]
common.inc:698 [0.96 sec, 31.9 МБ]
Drush command terminated abnormally due to an unrecoverable error.
должен быть Drush несоответствия версий с тем из Друпала. drush версия 5 работает с drupal 7, я думаю. –
@ViswanathPolaki Я так не думаю. По крайней мере, официальный сайт говорит, что Drush 7 совместим с Drupal 7.x – Alexey
Что произойдет, если вы наберете 'drush sqlc'? –