Solve the problem that composer cannot download the package under phpstudy2016

1. The latest php version requirement of composer is 7.2 or above

2. Composer Chinese mirror source has stopped serving, now the best domestic mirror source is Alibaba Cloud

Global mode (recommended):

$ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

Single project use:

$ composer config repo.packagist composer https://mirrors.aliyun.com/composer/

If the previously installed composer cannot download the laravel package, two things need to be done

1. Download the php7.3 version https://windows.php.net/downloads/releases/php-7.3.15-nts-Win32-VC15-x64.zip  

https://windows.php.net/download/

2. Delete the previously configured environment variables

3. Reinstall composer and select the php.exe path above php7.3

4. Modify the php.ini file in php7.3, open the open_ssl extension, and some other necessary extensions

.....
extension=bz2
;extension=curl
extension=fileinfo
extension=gd2
;extension=gettext
;extension=gmp
extension=intl
;extension=imap
;extension=interbase
;extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
extension=pdo_oci
extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop
.....

 

Guess you like

Origin blog.csdn.net/taotaobaobei/article/details/104637532