Skip to main content
Update
Source Link

[UPDATE: This part of problem SOLVED by @GiorgosK answer below. Other problems persist due to Drush not find mysql socket]

[UPDATE: This part of problem SOLVED by @GiorgosK answer below. Other problems persist due to Drush not find mysql socket]

I was one of the earliest users to find the bug, now there are more people with the same issue and better references available.
Source Link

How do I connect Drush 8 to a Drupal 7 local dbnot working correctly on (LAMP) Ubuntu 16.04

I am running LAMP on Ubuntu 16.04. I have a drupal 7 installation and I have installed drush 8.1.3 via composerComposer version 1. It appears that my problem is that Drush 85.12.13 I believe there is bug in php7.2 causing the error as discussed on Github, however even after I applied the recommended fix which is to update the pear/console_table to the latest version instructed here, the problem still remains. I also followed the instructions on Super User to be absolutely sure that I have the most up to date version of pear installed as well (did not connectinginstall PHPunit). And, FYI in accordance with the drush installation documentation found here, I also made the proper changes to any db for my drupal site.bashrc file as well (sbelow). The output of

Whenever I run drush status atI receive the command prompt isfollowing error:

drush status
PHP executable         count():  /usr/bin/php                   Parameter must be an array or an object that implements     [warning]
PHP configuration      : Countable /etc/php/7Table.1/cli/php.ini                     :789
PHP OS                 count():  Linux                          Parameter must be an array or an object that implements     [warning]
Drush script           : Countable /home/USER/vendor/drush/drush/drushTable.php :789
Drush version          count():  8.1.13                         Parameter must be an array or an object that implements     [warning]
Drush temp directory  Countable Table.php:  /tmp          789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Drush configuration   Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Drush alias files     Countable Table.php:   

and the result of drush status from inside a drupal installation is:

 drush status789
 PHP executable         :  /usr/bin/php                                 
 PHP configuration      :  /etc/php/7.12/cli/php.ini                     
 PHP OS                 :  Linux                                        
 Drush script           :  /home/USERwebdevusr/vendor/drush/drush/drush.php 
 Drush version          :  8.1.13                                       
 Drush temp directory   :  /tmp                                         
 Drush configuration    :                                               
 Drush alias files      :                                       

Obviously, these results do NOT include any information about the db that is being used .

drush sql-cli
Unable to load class Drush\Sql\Sql                                  [error]
Drush\Sql\SqlException: Unable to find a matching SQL Class. Drush   [error]
cannot find your database connection details. in  
/home/userwebdevusr/vendor/drush/drush/commands/sql/sql.drush.inc:541
Stack trace:
#0
/home/webdevusr/vendor/drush/drush/commands/sql/sql.drush.inc(221):
drush_sql_get_class()
#1 /home/webdevusr/vendor/drush/drush/includes/command.inc(422):
drush_sql_connect()
#2 /home/webdevusr/vendor/drush/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#3 /home/webdevusr/vendor/drush/drush/includes/command.inc(199):
drush_command()
#4
/home/webdevusr/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#5 /home/webdevusr/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 /home/webdevusr/vendor/drush/drush/drush.php(12): drush_main()
#7 {main}

Also, I have editedThe contents of my ~/.bashrc~/.bashrc file, adding the 2 lines beloware as follows:

export PATH="$HOME/.composer/vendor/bin:$PATH" 

export PATH=/bin:/usr/local/bin:/usr/local/mysql/bin:$PATH

# Include Drush bash customizations.
if [ -f "/home/webdevusr/.drush/drush.bashrc" ] ; then
source /home/webdevusr/.drush/drush.bashrc
fi

# Include Drush completion.

if [ -f "/home/webdevusr/.drush/drush.complete.sh" ] ; then
source /home/webdevusr/.drush/drush.complete.sh
fi

# Include Drush prompt customizations.

if [ -f "/home/webdevusr/.drush/drush.prompt.sh" ] ; then
source /home/webdevusr/.drush/drush.prompt.sh
fi

EDIT: The result of drush cc all executed from within my drupal installation folder is:

Anyone know how to connectget drush to the db(s)working for my local (LAMP) Drupal 7 installations?

How do I connect Drush 8 to a Drupal 7 local db (LAMP) Ubuntu 16.04

I am running LAMP on Ubuntu 16.04. I have a drupal 7 installation and I have installed drush 8.1.3 via composer. It appears that my problem is that Drush 8.1.13 is not connecting to any db for my drupal site(s). The output of drush status at the command prompt is:

drush status
PHP executable         :  /usr/bin/php                                 
PHP configuration      :  /etc/php/7.1/cli/php.ini                     
PHP OS                 :  Linux                                        
Drush script           :  /home/USER/vendor/drush/drush/drush.php 
Drush version          :  8.1.13                                       
Drush temp directory   :  /tmp                                         
Drush configuration    :                                               
Drush alias files      :   

and the result of drush status from inside a drupal installation is:

 drush status
 PHP executable         :  /usr/bin/php                                 
 PHP configuration      :  /etc/php/7.1/cli/php.ini                     
 PHP OS                 :  Linux                                        
 Drush script           :  /home/USER/vendor/drush/drush/drush.php 
 Drush version          :  8.1.13                                       
 Drush temp directory   :  /tmp                                         
 Drush configuration    :                                               
 Drush alias files      :                                       

Obviously, these results do NOT include any information about the db that is being used .

drush sql-cli
Unable to load class Drush\Sql\Sql                                 [error]
Drush\Sql\SqlException: Unable to find a matching SQL Class. Drush [error]
cannot find your database connection details. in /home/user/vendor/drush/drush/commands/sql/sql.drush.inc:541

Also, I have edited my ~/.bashrc file, adding the 2 lines below:

export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH=/bin:/usr/local/bin:/usr/local/mysql/bin:$PATH

EDIT: The result of drush cc all is:

Anyone know how to connect drush to the db(s) for my local (LAMP) Drupal 7 installations?

Drush 8 not working correctly on (LAMP) Ubuntu 16.04

I am running LAMP on Ubuntu 16.04. I have a drupal 7 installation and I have installed drush 8.1.3 via Composer version 1.5.2. I believe there is bug in php7.2 causing the error as discussed on Github, however even after I applied the recommended fix which is to update the pear/console_table to the latest version instructed here, the problem still remains. I also followed the instructions on Super User to be absolutely sure that I have the most up to date version of pear installed as well (did not install PHPunit). And, FYI in accordance with the drush installation documentation found here, I also made the proper changes to my .bashrc file as well (below).

Whenever I run drush status I receive the following error:

count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
count(): Parameter must be an array or an object that implements     [warning]
Countable Table.php:789
PHP executable         :  /usr/bin/php                                 
PHP configuration      :  /etc/php/7.2/cli/php.ini                     
PHP OS                 :  Linux                                        
Drush script           :  /home/webdevusr/vendor/drush/drush/drush.php 
Drush version          :  8.1.13                                       
Drush temp directory   :  /tmp                                         
Drush configuration    :                                               
Drush alias files      :   
Unable to load class Drush\Sql\Sql                                  [error]
Drush\Sql\SqlException: Unable to find a matching SQL Class. Drush   [error]
cannot find your database connection details. in 
/home/webdevusr/vendor/drush/drush/commands/sql/sql.drush.inc:541
Stack trace:
#0
/home/webdevusr/vendor/drush/drush/commands/sql/sql.drush.inc(221):
drush_sql_get_class()
#1 /home/webdevusr/vendor/drush/drush/includes/command.inc(422):
drush_sql_connect()
#2 /home/webdevusr/vendor/drush/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#3 /home/webdevusr/vendor/drush/drush/includes/command.inc(199):
drush_command()
#4
/home/webdevusr/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#5 /home/webdevusr/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 /home/webdevusr/vendor/drush/drush/drush.php(12): drush_main()
#7 {main}

The contents of my ~/.bashrc file, are as follows:

export PATH="$HOME/.composer/vendor/bin:$PATH" 

export PATH=/bin:/usr/local/bin:/usr/local/mysql/bin:$PATH

# Include Drush bash customizations.
if [ -f "/home/webdevusr/.drush/drush.bashrc" ] ; then
source /home/webdevusr/.drush/drush.bashrc
fi

# Include Drush completion.

if [ -f "/home/webdevusr/.drush/drush.complete.sh" ] ; then
source /home/webdevusr/.drush/drush.complete.sh
fi

# Include Drush prompt customizations.

if [ -f "/home/webdevusr/.drush/drush.prompt.sh" ] ; then
source /home/webdevusr/.drush/drush.prompt.sh
fi

The result of drush cc all executed from within my drupal installation folder is:

Anyone know how to get drush to working for my local (LAMP) Drupal 7 installations?

clarification
Source Link

EDIT: The result of drush cc all is:

No Drupal site found, only 'drush' cache was cleared. 

Anyone know how to connect drush to the db(s) for my local (LAMP) Drupal 7 installations?

Anyone know how to connect drush to the db(s) for my local (LAMP) Drupal 7 installations?

EDIT: The result of drush cc all is:

No Drupal site found, only 'drush' cache was cleared. 

Anyone know how to connect drush to the db(s) for my local (LAMP) Drupal 7 installations?

spelling
Source Link
Loading
Source Link
Loading