首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用Drush 10更新Drupal 9数据库和区域设置

无法使用Drush 10更新Drupal 9数据库和区域设置
EN

Stack Overflow用户
提问于 2021-06-27 21:35:08
回答 2查看 348关注 0票数 1

我在本地使用drush,没有任何问题,但是在我的主机上,locale和db更新有一个错误。我查了那么多东西,什么也没查到。奇怪的是,像config import/export、sql:dump、drush status这样的命令工作得很好,而且有一个工作的sql连接。

完整输出:

代码语言:javascript
复制
php74 vendor/bin/drush locale:import pl ../translations/custom-translations.pl.po --type=customized --override=all --debug
 [preflight] Config paths: /home/pathtomywebsite/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /home/pathtomywebsite/web/drush/sites,/home/pathtomywebsite/drush/sites
 [preflight] Commandfile search paths: /home/pathtomywebsite/vendor/drush/drush/src
 [debug] Bootstrap further to find locale:import [0.07 sec, 8.75 MB]
 [debug] Trying to bootstrap as far as we can [0.07 sec, 8.75 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.07 sec, 8.75 MB]
 [debug] Change working directory to /home/pathtomywebsite/web [0.07 sec, 8.75 MB]
 [debug] Initialized Drupal 9.2.0 root directory at /home/pathtomywebsite/web [0.07 sec, 8.75 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalSite() [0.07 sec, 9.08 MB]
 [debug] Initialized Drupal site default at sites/default [0.08 sec, 9.31 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.08 sec, 9.31 MB]
 [debug] Add service modifier [0.08 sec, 9.49 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalDatabase() [0.08 sec, 9.96 MB]
 [debug] Successfully connected to the Drupal database. [0.08 sec, 9.96 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalFull() [0.08 sec, 9.96 MB]
 [debug] Start bootstrap of the Drupal Kernel. [0.08 sec, 9.96 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [0.15 sec, 16.23 MB]
 [debug] Add a command: twig-tweak:validate [0.2 sec, 21.52 MB]
 [debug] Add a command: twig-tweak:debug [0.2 sec, 21.52 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [0.22 sec, 23.4 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [0.22 sec, 23.43 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [0.22 sec, 23.44 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [0.22 sec, 23.45 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [0.22 sec, 23.45 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [0.22 sec, 23.46 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DeployHookCommands [0.22 sec, 23.47 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [0.22 sec, 23.48 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [0.22 sec, 23.49 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\JsonapiCommands [0.22 sec, 23.5 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [0.22 sec, 23.5 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [0.22 sec, 23.51 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [0.22 sec, 23.53 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MigrateRunnerCommands [0.22 sec, 23.54 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [0.22 sec, 23.59 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [0.22 sec, 23.6 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [0.23 sec, 23.62 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [0.23 sec, 23.64 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [0.23 sec, 23.64 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [0.23 sec, 23.69 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [0.23 sec, 23.71 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [0.23 sec, 23.74 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [0.23 sec, 23.76 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.23 sec, 23.76 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.23 sec, 23.77 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.23 sec, 23.77 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.23 sec, 23.77 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.23 sec, 23.78 MB]
 [debug] Add a commandfile class: Drupal\entity_reference_revisions\Commands\EntityReferenceRevisionsCommands [0.23 sec, 23.78 MB]
 [debug] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.23 sec, 23.79 MB]
 [debug] Add a commandfile class: Drupal\pathauto\Commands\PathautoCommands [0.23 sec, 23.79 MB]
 [debug] Done with bootstrap max in Application::bootstrapAndFind(): trying to find locale:import again. [0.23 sec, 23.8 MB]
 [debug] Starting bootstrap to none [0.23 sec, 23.91 MB]
 [debug] Drush bootstrap phase 0 [0.23 sec, 23.91 MB]
 [debug] Try to validate bootstrap phase 0 [0.24 sec, 23.91 MB]
 [info] Executing: /home/pathtomywebsite/vendor/drush/drush/drush batch-process 15 --uri=default --root=/home/pathtomywebsite/web [0.27 sec, 25.74 MB]
> 
>                                                                                
>   Command batch-process was not found. Drush was unable to query the database  
>   . As a result, many commands are unavailable. Re-run your command with --de  
>   bug to see relevant log messages.                                            
>                                                                                
> 

In ProcessBase.php line 155:
                              
  [InvalidArgumentException]  
  Output is empty.            
                              

Exception trace:
  at /home/pathtomywebsite/vendor/consolidation/site-process/src/ProcessBase.php:155
 Consolidation\SiteProcess\ProcessBase->getOutputAsJson() at /home/pathtomywebsite/vendor/drush/drush/includes/batch.inc:157
 _drush_backend_batch_process() at /home/pathtomywebsite/vendor/drush/drush/includes/batch.inc:80
 drush_backend_batch_process() at /home/pathtomywebsite/vendor/drush/drush/src/Drupal/Commands/core/LocaleCommands.php:268
 Drush\Drupal\Commands\core\LocaleCommands->import() at n/a:n/a
 call_user_func_array() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/pathtomywebsite/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /home/pathtomywebsite/vendor/symfony/console/Application.php:1027
 Symfony\Component\Console\Application->doRunCommand() at /home/pathtomywebsite/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at /home/pathtomywebsite/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/pathtomywebsite/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /home/pathtomywebsite/vendor/drush/drush/src/Runtime/Runtime.php:48
 Drush\Runtime\Runtime->run() at /home/pathtomywebsite/vendor/drush/drush/drush.php:72
 require() at /home/pathtomywebsite/vendor/drush/drush/drush:4

冲刷状态:

代码语言:javascript
复制
php74 vendor/bin/drush status
 Drupal version   : 9.2.0                                                              
 Site URI         : http://default                                                     
 DB driver        : mysql                                                              
 DB hostname      : localhost                                                          
 DB port          : 3306                                                               
 DB username      : ****                                                     
 DB name          : ****                                                     
 Database         : Connected                                                          
 Drupal bootstrap : Successful                                                         
 Default theme    : ttp                                                                
 Admin theme      : seven                                                              
 PHP binary       : /usr/local/php7.4/bin/php                                          
 PHP config       : /usr/local/php7.4/php.ini                                          
 PHP OS           : Linux                                                              
 Drush script     : /home/pathtomywebsite/vendor/drush/drush/drush     
 Drush version    : 10.5.0                                                             
 Drush temp       : /tmp                                                               
 Drush configs    : /home/pathtomywebsite/vendor/drush/drush/drush.yml 
 Install profile  : standard                                                           
 Drupal root      : /home/pathtomywebsite/web                          
 Site path        : sites/default                                                      
 Files, Public    : sites/default/files                                                
 Files, Temp      : /tmp

sql:connection返回mysql的工作字符串。我卡住了,也许有人也有类似的问题?

updatedb命令的调试输出:

代码语言:javascript
复制
php74 vendor/bin/drush updatedb

In Process.php line 266:
                                                                                                                                                                                           
  The command "/home/pathtomywebsite/vendor/drush/drush/drush updatedb:status --no-entity-updates --uri=default --root=/home/pathtomywebsite/web" failed.  
                                                                                                                                                                                           
  Exit Code: 1(General error)                                                                                                                                                              
                                                                                                                                                                                           
  Working directory:                                                                                                                                                                       
                                                                                                                                                                                           
  Output:                                                                                                                                                                                  
  ================                                                                                                                                                                         
                                                                                                                                                                                           
                                                                                                                                                                                           
  Error Output:                                                                                                                                                                            
  ================                                                                                                                                                                         
                                                                                                                                                                                           
  In BootstrapHook.php line 32:                                                                                                                                                            
                                                                                                                                                                                           
    Bootstrap failed. Run your command with -vvv for more information.                                                                                                                     
                                                                                                                                                                                           

user@server:~/somepath$ php74 vendor/bin/drush updatedb -vvv
 [preflight] Config paths: /home/pathtomywebsite/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /home/pathtomywebsite/web/drush/sites,/home/pathtomywebsite/drush/sites
 [preflight] Commandfile search paths: /home/pathtomywebsite/vendor/drush/drush/src
 [debug] Starting bootstrap to full [0.06 sec, 8.78 MB]
 [debug] Drush bootstrap phase 5 [0.06 sec, 8.78 MB]
 [debug] Try to validate bootstrap phase 5 [0.06 sec, 8.78 MB]
 [debug] Try to validate bootstrap phase 5 [0.06 sec, 8.78 MB]
 [debug] Try to bootstrap at phase 5 [0.06 sec, 8.78 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.06 sec, 8.78 MB]
 [debug] Change working directory to /home/pathtomywebsite/web [0.06 sec, 8.78 MB]
 [debug] Initialized Drupal 9.2.0 root directory at /home/pathtomywebsite/web [0.06 sec, 8.78 MB]
 [debug] Try to validate bootstrap phase 5 [0.06 sec, 8.78 MB]
 [debug] Try to bootstrap at phase 5 [0.06 sec, 9.17 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalSite() [0.06 sec, 9.17 MB]
 [debug] Initialized Drupal site default at sites/default [0.06 sec, 9.34 MB]
 [debug] Try to validate bootstrap phase 5 [0.06 sec, 9.34 MB]
 [debug] Try to bootstrap at phase 5 [0.06 sec, 9.34 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.06 sec, 9.34 MB]
 [debug] Add service modifier [0.07 sec, 9.55 MB]
 [debug] Try to validate bootstrap phase 5 [0.07 sec, 9.55 MB]
 [debug] Try to bootstrap at phase 5 [0.07 sec, 10.06 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalDatabase() [0.07 sec, 10.06 MB]
 [debug] Successfully connected to the Drupal database. [0.07 sec, 10.06 MB]
 [debug] Try to validate bootstrap phase 5 [0.07 sec, 10.06 MB]
 [debug] Try to bootstrap at phase 5 [0.07 sec, 10.06 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalFull() [0.07 sec, 10.06 MB]
 [debug] Start bootstrap of the Drupal Kernel. [0.07 sec, 10.06 MB]
 [info] entity_reference_revisions should have an extra.drush.services section in its composer.json. See http://docs.drush.org/en/10.x/commands/#specifying-the-services-file. [0.1 sec, 12.42 MB]
 [debug] Found drush.services.yml for token Drush commands [0.1 sec, 12.57 MB]
 [info] twig_tweak should have an extra.drush.services section in its composer.json. See http://docs.drush.org/en/10.x/commands/#specifying-the-services-file. [0.1 sec, 12.57 MB]
 [debug] Found drush.services.yml for pathauto Drush commands [0.1 sec, 12.57 MB]
 [debug] Get container builder [0.1 sec, 12.59 MB]
 [debug] Service modifier alter. [0.11 sec, 12.69 MB]
 [debug] process drush.console.services console.command [0.17 sec, 17.37 MB]
 [debug] Found tagged service twig_tweak.validate [0.17 sec, 17.37 MB]
 [debug] Found tagged service twig_tweak.debug [0.17 sec, 17.37 MB]
 [debug] process drush.command.services drush.command [0.17 sec, 17.37 MB]
 [debug] Found tagged service config.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service config.export.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service config.import.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service batch.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service cli.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service drupal.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service deploy_hook.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service entity.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service image.commands [0.17 sec, 17.37 MB]
 [debug] Found tagged service jsonapi.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service language.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service locale.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service messenger.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service migrate_runner.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service queue.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service role.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service state.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service twig.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service user.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service views.commands [0.17 sec, 17.38 MB]
 [debug] Found tagged service watchdog.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service pm.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service theme.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service sanitize.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service sanitize.comments.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service sanitize.sessions.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service sanitize.userfields.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service sanitize.usertable.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service entity_reference_revisions.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service token.commands [0.17 sec, 17.39 MB]
 [debug] Found tagged service pathauto.commands [0.17 sec, 17.39 MB]
 [debug] process drush.command_info_alterer.services drush.command_info_alterer [0.17 sec, 17.39 MB]
 [debug] process drush.generator.services drush.generator [0.17 sec, 17.39 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [0.3 sec, 26.24 MB]
 [debug] Add a command: twig-tweak:validate [0.4 sec, 36.8 MB]
 [debug] Add a command: twig-tweak:debug [0.4 sec, 36.8 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [0.42 sec, 38.48 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [0.42 sec, 38.52 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [0.42 sec, 38.52 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [0.42 sec, 38.53 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [0.42 sec, 38.54 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [0.42 sec, 38.54 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DeployHookCommands [0.42 sec, 38.56 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [0.42 sec, 38.56 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [0.42 sec, 38.57 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\JsonapiCommands [0.42 sec, 38.58 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [0.42 sec, 38.59 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [0.42 sec, 38.6 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [0.42 sec, 38.62 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MigrateRunnerCommands [0.42 sec, 38.62 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [0.43 sec, 38.67 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [0.43 sec, 38.68 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [0.43 sec, 38.71 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [0.43 sec, 38.72 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [0.43 sec, 38.73 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [0.43 sec, 38.77 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [0.43 sec, 38.8 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [0.43 sec, 38.83 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [0.43 sec, 38.84 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.43 sec, 38.85 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.43 sec, 38.85 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.43 sec, 38.85 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.43 sec, 38.86 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.43 sec, 38.86 MB]
 [debug] Add a commandfile class: Drupal\entity_reference_revisions\Commands\EntityReferenceRevisionsCommands [0.43 sec, 38.87 MB]
 [debug] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.43 sec, 38.87 MB]
 [debug] Add a commandfile class: Drupal\pathauto\Commands\PathautoCommands [0.43 sec, 38.87 MB]
 [info] Executing: /home/pathtomywebsite/vendor/drush/drush/drush updatedb:status --no-entity-updates --uri=default --root=/home/pathtomywebsite/web [0.56 sec, 41.87 MB]

In Process.php line 266:
                                                                                                                                                                                           
  [Symfony\Component\Process\Exception\ProcessFailedException]                                                                                                                             
  The command "/home/pathtomywebsite/vendor/drush/drush/drush updatedb:status --no-entity-updates --uri=default --root=/home/pathtomywebsite/web" failed.  
                                                                                                                                                                                           
  Exit Code: 1(General error)                                                                                                                                                              
                                                                                                                                                                                           
  Working directory:                                                                                                                                                                       
                                                                                                                                                                                           
  Output:                                                                                                                                                                                  
  ================                                                                                                                                                                         
                                                                                                                                                                                           
                                                                                                                                                                                           
  Error Output:                                                                                                                                                                            
  ================                                                                                                                                                                         
                                                                                                                                                                                           
  In BootstrapHook.php line 32:                                                                                                                                                            
                                                                                                                                                                                           
    Bootstrap failed. Run your command with -vvv for more information.                                                                                                                     
                                                                                                                                                                                           

Exception trace:
  at /home/pathtomywebsite/vendor/symfony/process/Process.php:266
 Symfony\Component\Process\Process->mustRun() at /home/pathtomywebsite/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php:67
 Drush\Commands\core\UpdateDBCommands->updatedb() at n/a:n/a
 call_user_func_array() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /home/pathtomywebsite/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /home/pathtomywebsite/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /home/pathtomywebsite/vendor/symfony/console/Application.php:1027
 Symfony\Component\Console\Application->doRunCommand() at /home/pathtomywebsite/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at /home/pathtomywebsite/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /home/pathtomywebsite/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /home/pathtomywebsite/vendor/drush/drush/src/Runtime/Runtime.php:48
 Drush\Runtime\Runtime->run() at /home/pathtomywebsite/vendor/drush/drush/drush.php:72
 require() at /home/pathtomywebsite/vendor/drush/drush/drush:4
EN

回答 2

Stack Overflow用户

发布于 2021-09-24 13:48:14

在用更新的PHP版本更新docker容器后,我也遇到了同样的问题。我能够通过比较php.ini来追踪这个问题。不同之处在于variables_order设置。

在终端中执行以下命令,检查这些值:

代码语言:javascript
复制
php -i | grep variables_order

在我的例子中,输出是:

代码语言:javascript
复制
variables_order => GPCS => GPCS

切换到EGPCS后,脚本成功运行。

要更新值,请在php.ini文件中将variables_order设置为"EGPCS"。您可以通过在终端中运行获取配置文件的路径:

代码语言:javascript
复制
php --ini

它将列出包含的所有配置文件。使用顶部带有标签Loaded Configuration File的配置,配置必须在那里。在我的例子中是:

代码语言:javascript
复制
Loaded Configuration File:         /usr/local/etc/php/php.ini

找到variables_order并确保您的配置如下:

代码语言:javascript
复制
variables_order = "EGPCS"
票数 0
EN

Stack Overflow用户

发布于 2021-09-25 21:13:32

在我的例子中,问题出在我主机上的php版本。要使用7.4运行,我必须使用php74 cli:

代码语言:javascript
复制
**php74** vendor/bin/drush updatedb

Drush将不能与自定义php二进制名称一起工作。即使我在drush classess中修改了这个路径,仍然得到了同样的错误。已知的bug在drush github问题上发布了几次。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68151737

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档