実現したいこと
- php -n /usr/local/bin/composer install --verbose --prefer-dist --no-progress
上記のコマンドでエラーが発生するため、解消したい
前提
・環境構築時にエラー
・makeコマンド使用して実行
・Symfony3.4.35
・PHP 7.1.0
・Composer 2.2.9
発生している問題・エラーメッセージ
> post-install-cmd: @symfony-build-bootstrap > symfony-build-bootstrap: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap In Process.php line 143: [TypeError] Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, called in /var/www/argama/argama_staff/vendor/sensio/distribution-bundle/Composer/ScriptHandler.php on line 310 Exception trace: at phar:///usr/local/bin/composer/vendor/symfony/process/Process.php:143 Symfony\Component\Process\Process->__construct() at /var/www/argama/argama_staff/vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:310 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeBuildBootstrap() at /var/www/argama/argama_staff/vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:88 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:439 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:257 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:113 Composer\EventDispatcher\EventDispatcher->dispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:237 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:129 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:380 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:146 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1040 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:301 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:377 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:141 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:88 require() at /usr/local/bin/composer:29 install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
該当のソースコード
PHP
1 protected static function executeBuildBootstrap(Event $event, $bootstrapDir, $autoloadDir, $timeout = 300) 2 { 3 $php = ProcessExecutor::escape(static::getPhp(false)); 4 $phpArgs = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), static::getPhpArguments())); 5 $cmd = ProcessExecutor::escape(__DIR__.'/../Resources/bin/build_bootstrap.php'); 6 $bootstrapDir = ProcessExecutor::escape($bootstrapDir); 7 $autoloadDir = ProcessExecutor::escape($autoloadDir); 8 $useNewDirectoryStructure = ''; 9 if (static::useNewDirectoryStructure(static::getOptions($event))) { 10 $useNewDirectoryStructure = ProcessExecutor::escape('--use-new-directory-structure'); 11 } 12 13 **---エラー箇所** 14 $process = new Process($php.($phpArgs ? ' '.$phpArgs : '').' '.$cmd.' '.$bootstrapDir.' '.$autoloadDir.' '.$useNewDirectoryStructure, getcwd(), null, null, $timeout); 15 $process->run(function ($type, $buffer) use ($event) { $event->getIO()->write($buffer, false); }); 16 if (!$process->isSuccessful()) { 17 throw new \RuntimeException('An error occurred when generating the bootstrap file.'); 18 } 19 }
試したこと
1. composer updateの実行 → 特に変化なし
2. composer.lockファイルを削除。その後、comoser installを再実行 → 失敗
3. タイムアウト時間を増やす
- 番号リスト config.json にタイムアウト600を指定,
- composer install --timeout=600 => 失敗,
- 上記コードのタイムアウト指定を600に変更 => 失敗,
補足情報
エラー箇所のコードGitHub
https://github.com/sensiolabs/SensioDistributionBundle/blob/80a38234bde8321fb92aa0b8c27978a272bb4baf/Composer/ScriptHandler.php#L310
プライベートリポジトリのため公開できる部分はすくないですが、環境構築が進まず開発ができない状態です。
どなたか、わかる方いましたら助けていただきたいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/03/12 16:45
2023/03/12 16:46 編集