这里详细描述问题
安装webman1.5.5报错
PHP版本:8.0.30 (cli) (built: Nov 21 2023 16:16:21) ( NTS )
COMPOSER版本:2.7.7 (2.x channel)
composer install -vvv
Running 2.7.7 (2024-06-10 22:11:12) with PHP 8.0.30 on Linux / 4.15.0-213-generic
Reading ./composer.json (/mnt/projects/lonsdor-center/composer.json)
Loading config file /root/.composer/config.json
Loading config file /root/.composer/auth.json
Loading config file ./composer.json (/mnt/projects/lonsdor-center/composer.json)
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/mnt/projects/lonsdor-center): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing command (/mnt/projects/lonsdor-center): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/mnt/projects/lonsdor-center): git log --pretty="%H" -n1 HEAD
Executing command (/mnt/projects/lonsdor-center): hg branch
Executing command (/mnt/projects/lonsdor-center): fossil branch list
Executing command (/mnt/projects/lonsdor-center): fossil tag list
Executing command (/mnt/projects/lonsdor-center): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Reading /root/.composer/cache/repo/https---repo.packagist.org/packages.json from cache
Downloading https://repo.packagist.org/packages.json if modified
[304] https://repo.packagist.org/packages.json
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-workerman~webman-framework.json from cache
Downloading https://repo.packagist.org/p2/workerman/webman-framework.json if modified
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-monolog~monolog.json from cache
Downloading https://repo.packagist.org/p2/monolog/monolog.json if modified
[304] https://repo.packagist.org/p2/workerman/webman-framework.json
[304] https://repo.packagist.org/p2/monolog/monolog.json
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-workerman~workerman.json from cache
Downloading https://repo.packagist.org/p2/workerman/workerman.json if modified
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-nikic~fast-route.json from cache
Downloading https://repo.packagist.org/p2/nikic/fast-route.json if modified
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-psr~container.json from cache
Downloading https://repo.packagist.org/p2/psr/container.json if modified
Reading /root/.composer/cache/repo/https---repo.packagist.org/provider-psr~log.json from cache
Downloading https://repo.packagist.org/p2/psr/log.json if modified
[304] https://repo.packagist.org/p2/workerman/workerman.json
[304] https://repo.packagist.org/p2/nikic/fast-route.json
[304] https://repo.packagist.org/p2/psr/container.json
[304] https://repo.packagist.org/p2/psr/log.json
Built pool.
Running pool optimizer.
Pool optimizer completed in 0.001 seconds
Found 177 package versions referenced in your dependency graph. 100 (56%) were optimized away.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.
Something's changed, looking at all rules again (pass #1)
Dependency resolution completed in 0.000 seconds
Analyzed 77 packages to resolve dependencies
Analyzed 91 rules to resolve dependencies
Lock file operations: 6 installs, 0 updates, 0 removals
Installs: psr/log:3.0.0, monolog/monolog:2.9.3, psr/container:2.0.2, nikic/fast-route:v1.3.0, workerman/workerman:v4.1.15, workerman/webman-framework:v1.5.19
- Locking monolog/monolog (2.9.3) from composer repo (https://repo.packagist.org)
- Locking nikic/fast-route (v1.3.0) from composer repo (https://repo.packagist.org)
- Locking psr/container (2.0.2) from composer repo (https://repo.packagist.org)
- Locking psr/log (3.0.0) from composer repo (https://repo.packagist.org)
- Locking workerman/webman-framework (v1.5.19) from composer repo (https://repo.packagist.org)
- Locking workerman/workerman (v4.1.15) from composer repo (https://repo.packagist.org)
Writing lock file
Installing dependencies from lock file (including require-dev)
Reading ./composer.lock (/mnt/projects/lonsdor-center/composer.lock)
Package operations: 6 installs, 0 updates, 0 removals
Installs: psr/log:3.0.0, monolog/monolog:2.9.3, workerman/workerman:v4.1.15, psr/container:2.0.2, nikic/fast-route:v1.3.0, workerman/webman-framework:v1.5.19
Reading /root/.composer/cache/files/psr/log/4109d4b3f74b78a13cb175029bcb2384f59f0a52.zip from cache
- Loading psr/log (3.0.0) from cache
Reading /root/.composer/cache/files/monolog/monolog/b75847fa999683a0a1ef84120b330e4c29c81e34.zip from cache
- Loading monolog/monolog (2.9.3) from cache
Reading /root/.composer/cache/files/workerman/workerman/d43cd0ee8b8ec96a6eb9c6ae979f31abce3b18be.zip from cache
- Loading workerman/workerman (v4.1.15) from cache
Reading /root/.composer/cache/files/psr/container/a0a43e15cb16e3ab95a991e1bffc813474b15cdf.zip from cache
- Loading psr/container (2.0.2) from cache
Reading /root/.composer/cache/files/nikic/fast-route/9fc18cb64621a29fa485259432d1c2676733e347.zip from cache
- Loading nikic/fast-route (v1.3.0) from cache
Reading /root/.composer/cache/files/workerman/webman-framework/1f39a0bd3f40d3aecaa06d7177cf59a1f1c2cc64.zip from cache
- Loading workerman/webman-framework (v1.5.19) from cache
- Installing psr/log (3.0.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-139e00a143f0a2bcec8a832fceff17e9.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/6a5cfaf8'
- Installing monolog/monolog (2.9.3): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-4dc2f06a343d71349bc07a1349bec7f2.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/b0809db5'
- Installing workerman/workerman (v4.1.15): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-76b3f06683e705ff17ff3de5566140e7.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/c136d8b8'
- Installing psr/container (2.0.2): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-9420b3d8ea98aa246419319eb450781a.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/fec25cdd'
- Installing nikic/fast-route (v1.3.0): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-e4835fdcb4674189f8df942497518c29.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/35777a32'
- Installing workerman/webman-framework (v1.5.19): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/mnt/projects/lonsdor-center/vendor/composer/tmp-f44ad36314bd7fe5eb6375d536b5b5c4.zip' -d '/mnt/projects/lonsdor-center/vendor/composer/29ee2a36'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/6a5cfaf8'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/fec25cdd'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/c136d8b8'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/35777a32'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/29ee2a36'
Executing async command (CWD): rm -rf '/mnt/projects/lonsdor-center/vendor/composer/b0809db5'
Downloading https://packagist.org/downloads/
[201] https://packagist.org/downloads/
In ClassLoader.php line 576:
[ErrorException]
include(/mnt/projects/lonsdor-center/vendor/workerman/webman-framework/src/support/Plugin.php): Failed to open stream: No such file or directory
Exception trace:
at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:576
Composer\Util\ErrorHandler::handle() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:576
include() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:576
Composer\Autoload\{closure}() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:427
Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
class_exists() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:256
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:150
Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:396
Composer\Installer\InstallationManager::Composer\Installer\{closure}() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:411
Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:319
Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:218
Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:837
Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:649
Composer\Installer->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Installer.php:298
Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:147
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:394
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:148
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:93
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>...]
使用
composer create-project workerman/webman
也会报错使用的是官方的源,也使用过国内源,都是一样的报错
composer self-update
升级composer试下
已经是最新版本了,2.7.7,You are already using the latest available Composer version 2.7.7 (stable channel).
再次输入
composer install -vvv
就显示已经完成了上面问题解决了,我有一个细节没有提供,我使用的是VirtualBox+Vagrant+Docker来管理项目的,这个问题的原因是VirtualBox那边在写入文件后马上访问会出现问题,后面composer针对这个情况做了修复,会检查环境是否是vm做出相应的处理,但是在docker容器显然无法知道是否是VM环境的,所以问题还会出现,解决办法就是在容器中运行
export COMPOSER_RUNTIME_ENV=virtualbox
来帮助composer确认环境,然后再运行composer install
就不会出错了。上面问题解决了,我有一个细节没有提供,我使用的是VirtualBox+Vagrant+Docker来管理项目的,这个问题的原因是VirtualBox那边在写入文件后马上访问会出现问题,后面composer针对这个情况做了修复,会检查环境是否是vm做出相应的处理,但是在docker容器显然无法知道是否是VM环境的,所以问题还会出现,解决办法就是在容器中运行
export COMPOSER_RUNTIME_ENV=virtualbox
来帮助composer确认环境,然后再运行composer install
就不会出错了。