> 개발 도구 > composer > 본문

이러한 작곡가 오류가 발생했나요?

藏色散人
풀어 주다: 2021-11-09 16:44:01
앞으로
2133명이 탐색했습니다.

이 글은 composer튜토리얼 칼럼에서 작곡가가 겪게 되는 몇 가지 오류를 소개하기 위해 작성되었습니다. 도움이 필요한 친구들에게 도움이 되길 바랍니다!

작곡가에서 발생한 오류 모음

1#Permission error

file_put_contents(/home/vagrant/.composer/cache/repo/https---packagist.laravel-china.org/packages.json): failed to open stream: Permission denied
https://packagist.laravel-china.org could not be fully loaded, package information was loaded from the local cache and may be out of date
로그인 후 복사

해결 방법: sudo chown -R $USER ~/.composer/

2# zlib_decode():data error

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
로그인 후 복사

: 작곡가의 repo.packagist 교체

3# SSL 루틴:ssl3_get_server_certificate:인증서 확인 실패

오류 설명

- Installing phpunit/phpunit (6.5.8): Downloading (failed)
Downloading (failed)
Downloading (failed)    Failed to download phpunit/phpunit from dist: The "https://files.phpcomposer.com/files/sebastianbergmann/phpunit/4f21a3c6b97c42952fd5c2837bb354ec0199b97b.zip" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
    Now trying to download from source
로그인 후 복사

Solution

In my case, it was the CA Cert file that was the culprit
Open terminal and run php -r "var_dump(openssl_get_cert_locations());"
Note the location of default_cert_file. It might say \usr\local\ssl\cert.pem
Verify that that file exists. If not, download the cacert.pem file from https://curl.haxx.se/ca/cacert.pem and place it in somewhere preferably in /usr/local/ssl
You now have a file is usr/local/ssl/cacert.pem
Open your php.ini and add the location of the file openssl.cafile=cacert.pem
Run composer config --global cafile "/usr/local/ssl/cacert.pem"
If it's of any use to others, I use valet+ 1.0.26, composer 1.8.4 OSX Movajes 10.14.3, php7.3 and simply specifying the cert composer looks for with:
composer config --global cafile "/usr/local/etc/openssl/cert.pem"
로그인 후 복사
composer config --global cafile "C:/AMP_ENV/php-7.1.15/ca/cacert.pem"
composer config --global --list
로그인 후 복사

4# proc_open(): 포크 실패 - 메모리를 할당할 수 없음

오류 설명

Installation failed, reverting ./composer.json to its original content.
The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952
Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952
  [ErrorException]
  proc_open(): fork failed - Cannot allocate memory
로그인 후 복사

Solution

sudo dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo mkswap /var/swap.1
sudo swapon /var/swap.1
로그인 후 복사

5# Composer Throw 실행 중 Killed

오류 설명

root@test2:/work/usrc$ composer require qcloud/cos-sdk-v5
./composer.json has been updated
The "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asset.installer-paths" option
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed
로그인 후 복사

Solution

이 이유는 대부분 캐시가 부족하여 발생합니다. Linux 환경에서는 문제를 해결하기 위해 캐시를 늘릴 수 있습니다.

아아아아

위 내용은 이러한 작곡가 오류가 발생했나요?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:juejin.im
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!