composer常见问题

1.没有稳定版的库

composer require phois/whois
[InvalidArgumentException]
 Could not find package phois/whois at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [packages1] ... [packag
 esN]

没有稳定版本stable release,使用@dev版本表示安装开发版

composer require phois/whois:@dev

2. PHP 5.6 错误

$ composer create-project laravel/laravel domain --prefer-dist
 Installing laravel/laravel (v5.1.11)
 - Installing laravel/laravel (v5.1.11)
 Downloading: 100%
 Downloading: 100%
 Downloading: 100%
 Failed to download laravel/laravel from dist: The "https://api.github.com/repos/laravel/laravel/zipball/716e65268ae088e5bd73e505acf9695c127aff66" 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
 - Installing laravel/laravel (v5.1.11)
 Cloning 716e65268ae088e5bd73e505acf9695c127aff66

编辑php.ini,加上一行用来指定openssl的cafile:

openssl.cafile = "C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem"

没有安装perl的话,手动下载

http://curl.haxx.se/ca/cacert.pem

3 .国内镜像

$ composer create-project laravel/laravel domain.dev --prefer-dist
 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

composer仓库国内镜像:

http://pkg.phpcomposer.com/
http://packagist.cn/

修改全局配置,换成国内地址

composer config -g repositories.packagist composer http://packagist.phpcomposer.co

4.snmpwalk错误

Cannot adopt OID in SQUID-MIB: cacheClients ::= { cacheProtoAggregateStats 15 }
Cannot adopt OID in NET-SNMP-EXTEND-MIB: nsExtendLineIndex ::= { nsExtendOutput2Entry 1 }
Cannot adopt OID in NET-SNMP-EXTEND-MIB: nsExtendOutLine ::= { nsExtendOutput2Entry 2 }
Cannot adopt OID in UCD-SNMP-MIB: laIndex ::= { laEntry 1 }
Cannot adopt OID in UCD-SNMP-MIB: laNames ::= { laEntry 2 }
Cannot adopt OID in UCD-SNMP-MIB: laLoad ::= { laEntry 3 }
Cannot adopt OID in UCD-SNMP-MIB: laConfig ::= { laEntry 4 }
Cannot adopt OID in UCD-SNMP-MIB: laLoadInt ::= { laEntry 5 }
Cannot adopt OID in UCD-SNMP-MIB: laLoadFloat ::= { laEntry 6 }
Cannot adopt OID in UCD-SNMP-MIB: laErrorFlag ::= { laEntry 100 }
Cannot adopt OID in UCD-SNMP-MIB: laErrMessage ::= { laEntry 101 }
Cannot adopt OID in NET-SNMP-AGENT-MIB: nsNotifyRestart ::= { netSnmpNotifications 3 }
Cannot adopt OID in NET-SNMP-AGENT-MIB: nsNotifyShutdown ::= { netSnmpNotifications 2 }
Cannot adopt OID in NET-SNMP-AGENT-MIB: nsNotifyStart ::= { netSnmpNotifications 1 }

安装即可

apt-get install snmp-mibs-downloader