Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there:
I'm trying to run Drush for speeding the migration of a lot of records and I'm getting these errors:
$ drush migrate status
Cannot set variable `max_execution_time` to `60` in your PHP configuration!Probably you do not have proper privileges. [error]
Command migrate status needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this [error]
command.
The command 'drush.php migrate status' could not be executed.
The same with any other command I've tried, except drush -d status
that comes up with:
Found command: status [0.044 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.045 sec] [bootstrap]
Initialized Drupal 6.14 root directory at /var/www/siteroot [0.063 sec] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.063 sec] [bootstrap]
Initialized Drupal site default at sites/default [0.099 sec] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.114 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.118 sec] [bootstrap]
Successfully connected to the Drupal database. [0.118 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.125 sec] [bootstrap]
Cannot set variable `max_execution_time` to `60` in your PHP configuration!Probably you do not have proper privileges. [0.363 sec] [error]
Including non-version specific file : /home/ari/drush/commands/core/drupal/environment.inc [0.363 sec] [notice]
PHP configuration : /etc/php5/cli/php.ini
Drupal Root : /var/www/siteroot
Drupal version : 6.14
Site Path : sites/default
Site URI : http://default
Database Driver : mysql
Database Hostname : localhost
Database Username : root
Database Name : db_name
Database Password : db_pass
Database : Connected
Drupal Bootstrap : Successful
Drupal User : Anonymous
An error occurred at function : drush_core_status [0.503 sec] [error]
Command dispatch complete [0.503 sec] [notice]
Timer 'page' is 0.389 sec. [0.504 sec]
The PHP error continues showing, although /etc/php5/cli/php.ini has:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 228M ; Maximum amount of memory a script may consume (16MB)
Thanks for your help.
Comments
Comment #1
ari-meetai CreditAttribution: ari-meetai commentedanyone?
Comment #2
ari-meetai CreditAttribution: ari-meetai commentedcan't find an answer to this as of yet.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentednot really a drush issue AFAICT. we don't mess with max_execution_time since it has no effect on CLI PHP
Comment #4
rezha CreditAttribution: rezha commentedDid someone solve this?
Comment #5
jhedstromI just ran into this on a site where the drupal_tweaks module was enabled. I didn't have time to debug that module, but disabling it made the issue go away. It has something to do with that module calling ini_set with empty parameters, or parameters that can't be changed at runtime from php-cli.
Comment #6
webthingee CreditAttribution: webthingee commentedI have found that on a site with any multi-sites (i.e. I run domain.com, and domain.l to keep seperate db's for development). I have had to use the commands for drupal as such:
Comment #7
freephile CreditAttribution: freephile commentedI've run into this same problem but haven't solved it. The only command I can run is 'status' which seems to ignore the error in drush_core_status as it executes the _drush_bootstrap_drupal_full()
drush -d -l dev.beangroup.com sm
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.05 sec, 2.36 MB] [bootstrap]
Initialized Drupal 6.19 root directory at /var/www/drupal [0.06 sec, 3.01 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.07 sec, 3.01 MB] [bootstrap]
Initialized Drupal site dev.beangroup.com at sites/dev.beangroup.com [0.18 sec, 3.42 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.2 sec, 3.71 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.24 sec, 4.06 MB] [bootstrap]
Successfully connected to the Drupal database. [0.24 sec, 4.06 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.25 sec, 4.07 MB] [bootstrap]
: in (line of ). [0.32 sec, 8.3 MB] [error]
Command pm-list needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command. [0.32 sec, 8.3 MB] [error]
The drush command 'sm' could not be executed. [0.32 sec, 8.3 MB] [error]
grundlett@WS02:/var/www/drupal$ drush -d -l dev.beangroup.com status
Found command: core-status (commandfile=core) [0.05 sec, 2.36 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.05 sec, 2.37 MB] [bootstrap]
Initialized Drupal 6.19 root directory at /var/www/drupal [0.06 sec, 3.02 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.06 sec, 3.02 MB] [bootstrap]
Initialized Drupal site dev.beangroup.com at sites/dev.beangroup.com [0.18 sec, 3.44 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.18 sec, 3.44 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.19 sec, 3.79 MB] [bootstrap]
Successfully connected to the Drupal database. [0.19 sec, 3.79 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.19 sec, 3.79 MB] [bootstrap]
: in (line of ). [0.28 sec, 8.03 MB] [error]
Drupal version : 6.19
Site URI : dev.beangroup.com
Database driver : mysqli
Database hostname : 127.0.0.1
Database username : XXXXXX < redacted
Database name : XXXXXX < redacted
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : garland
Administration theme : minnelli
PHP configuration : /etc/php5/cli/php.ini
Drush version : 3.3
Drush configuration : /etc/drush/drushrc.php
Drupal root : /var/www/drupal
Site path : sites/dev.beangroup.com
File directory path : sites/beangroup.com/files
An error occurred at function : drush_core_status [0.28 sec, 8.02 MB] [error]
Command dispatch complete [0.28 sec, 8.01 MB] [notice]
Timer Cum (sec) Count Avg (msec)
page 0.105 1 104.82
Peak memory usage was 8.09 MB [0.28 sec, 8.01 MB] [memory]
Comment #8
NickWebman CreditAttribution: NickWebman commentedummm... I got this problem when I was in the home directory instead of the whatever.com directory.
Lame, yes, but perhaps this helps another person searching for the same issue...
Comment #9
aangel CreditAttribution: aangel commentedNot likely to be drush...turning off Drupal Tweaks made my occurrence of this error go away.
Comment #10
brycesenz CreditAttribution: brycesenz commentedI faced the same problem, and turning off Drupal Tweaks solved my issue as well.
Comment #11
sphism CreditAttribution: sphism commented--user=1
might help
Comment #12
wizonesolutionsDrupal Tweaks was the issue for me as well. Is the module still maintained? It should be reported as an issue there. I'll check...
Comment #13
tribsel CreditAttribution: tribsel commentedi have this problem too and dont use drupal tweaks.
Comment #14
montchr CreditAttribution: montchr commentedI'm also having this problem and I don't use Drupal Tweaks either.
I'm able to run a dl command fine but it seems like anything else gives me this message.
Comment #15
mattez CreditAttribution: mattez commentedLoot at this disq: #1011932: Support unix_socket in D7 $databases var in settings.php
Comment #6 try 2) worked form me.
I changed DB setup in settings.php from 'localhost' to its IP '127.0.0.1'
Comment #16
leer CreditAttribution: leer commentedOn Windows 7, running the command from the sites\default directory (per Comment #8), rather than the Drush directory, worked for me.
Comment #17
joachim CreditAttribution: joachim commented> I changed DB setup in settings.php from 'localhost' to its IP '127.0.0.1'
Made no change for me.
> running the command from the sites\default directory
Made no change for me.
I have started seeing this error since I upgraded MAMP to 2.0.5, and hence am now running my localhost sites on PHP 5.3 rather than 5.2.
I've chased the problem as far as drush_valid_db_credentials().
Removing the @ in front of the call to mysqli_real_connect() in drush_valid_db_credentials() shows me this:
A workaround is to do this:
$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
but shouldn't mysqli stuff be able to find the socket? Drupal running in the browser seems to connect ok.
Comment #18
e0ipsoThis worked form me.
Thanks!
Comment #19
ByteSlinger CreditAttribution: ByteSlinger commentedI'm not using MAMP, but Acquia Drupal Dev Desktop. I had the "needs a higher bootstrap level" error and changing localhost to 127.0.01 in my settings.php file solved the problem. Thanks mattez!
Comment #20
lanquarem CreditAttribution: lanquarem commentedI had the same problem with Mamp on MacOS.
It came from the MAMP preferences : by default, the ports for MySQL and Apache in MAMP are 8888 and 8889 .
I selected the "default ports" option (80 for Apache and 3306 for MySQL) and Drush now works perfectly : no more bootstrap level error message.
Comment #21
Kjartan CreditAttribution: Kjartan commented#437642: support for different MYSQL socket added support for unix_socket, so if you have it setup correctly in your sites settings.php it should work properly.
The actual issue here is a misconfiguration in mysql and/or php, usually as a result of the website using one php config while php-cli uses another. If you modify settings.php and add a unix_socket to the database configuration you can force Drupal and Drush to use the same socket.
Comment #22
Danny EnglanderI spent days trying to find a fix for this issue so I am glad I found this finally. #18 is great but just in case the directory does not exist in the first place, i also did this command first:
sudo mkdir /var/mysql
So the final commands in order would be:
Comment #23
tomgf CreditAttribution: tomgf commentedTrying to tackle a similar problem I have found out that drush was using a php.ini (~/.drush/php.ini) that was not including the proper PDO drivers:
Comparing it with the php.ini from MAMP, I noticed that there were some missing directives, particularly these:
Adding these directives to my ~/.drush/php.ini solved the problem and now drush runs without inconveniences on my MAMP environment:
Note: I found out this problem running drush -d|--debug, that provides extra information.
Comment #24
1richards CreditAttribution: 1richards commented#15 fixed this for me. Took too darn long to find this... Thanks!