Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the errors of composer

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to understand the mistakes of composer, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Collection of errors encountered by composer

Invalid 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

Solution: sudo chown-R $USER ~ / .composer/

Optional zlib_decode (): data error

Failed to decode response: zlib_decode (): data errorRetrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info

The solution is to change the repo.packagist of composer

3# SSL routines:ssl3_get_server_certificate:certificate verify failed

Error description

-Installing phpunit/phpunit (6.5.8): 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 failedFailed to enable cryptofailed to open stream: operation failed Now trying to download from source

Solution

In my case, it was the CA Cert file that was the culpritOpen 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.pemVerify 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/sslYou now have afile is usr/local/ssl/cacert.pemOpen your php.ini and add the location of the file openssl.cafile=cacert.pemRun 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

Fork failed proc_open (): fork failed-Cannot allocate memory

Error description

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 configuredCheck https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for detailsPHP Warning: proc_open (): fork failed-Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 952Warning: 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 method

Sudo dd if=/dev/zero of=/var/swap.1 bs=1M count=1024sudo mkswap / var/swap.1sudo swapon / var/swap.1

Execute composer to throw Killed

Error description

Root@test2:/work/usrc$ composer require qcloud/cos-sdk-v5./composer.json has been updatedThe "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asset.installer-paths" optionLoading composer repositories with package informationUpdating dependencies (including require-dev) Killed

Solution method

This is mostly due to insufficient caching, and caching solutions can be added in the linux environment.

Free-msudo mkdir-p / var/_swap_cd / var/_swap_sudo dd if=/dev/zero of=swapfile bs=1M count=2000sudo mkswap swapfilesudo swapon swapfilesudo echo "/ var/_swap_/swapfile none swap sw 00" > > / etc/fstabfree-m is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report