I am not able to get drush to work properly:
1) I can download modules & themes through drush but I cannot enable them (more details below). 2) Also I cannot use the omega commands even though they are listed (more details below).
= I installed Composer & Drush as per docs.drush.org/en/master/install/ = Drush is properly installed on my computer, when I type drush version I get: Drush Version : 7.0-dev
My system setup: Linux mint 17 KDE with Xampp 1.8.3-4
I guess my problems are (partly?) caused because Drush was not able to start (bootstrap) the Drupal database. So I run mysql from command line:
user@mylaptop:/opt/lampp/htdocs/drush/sites/all/modules > mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
In my system mysqld.sock
is in a different location, namely /opt/lampp/var/mysql/mysql.sock. So I created a symbolic link in /var/run/mysqld/ but this has no effect. Still have the same problems. Maybe caused by permissions?
I have spend a few days of and on (had to stop out of frustration) and I cannot get drush to work.
Details of my problems: 1) I can download modules & themes through drush but I cannot enable them:
user@mylaptop:/opt/lampp/htdocs/drush/sites/all/modules > drush en disqus
Command pm-enable needs a higher bootstrap level to run - you will need to invoke [error]
drush from a more functional Drupal environment to run this command.
The drush command 'en disqus' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See drush topic docs-aliases for details.
connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.34
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port :
Database username : root
Database name : drush
PHP executable : /usr/bin/php
PHP configuration : /etc/php5/cli/php.ini
PHP OS : Linux
Drush version : 7.0-dev
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /opt/lampp/htdocs/drush
Site path : sites/default
When I add
'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',
or:
'host' => '127.0.0.1',
to settings.php as per this post I get following error:
user@mylaptop:/opt/lampp/htdocs/drush/sites/all/modules > drush en disqus
PHP Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /opt/lampp/htdocs/drush/includes/database/mysql/database.inc on line 46
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in
/opt/lampp/htdocs/drush/includes/database/mysql/database.inc, line 46
2) Also I cannot use the omega commands even though they are listed:
user@mylaptop:/opt/lampp/htdocs/drush/sites/all/modules > drush help --filter=omega
All commands in omega: (omega)
omega-export (oexp) Exports the theme settings of a given theme from the database to the
.info file.
omega-guard (ogrd) Runs guard for the given theme including Compass and LiveReload by
default.
omega-revert (orev) Reverts the theme settings of a given theme by deleting them from the
database.
omega-subtheme Creates a Omega subtheme.
(osub)
omega-wizard (owiz) Guides you through a wizard for generating a subtheme