Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks()
参考这里:https://github.com/francoispluchino/composer-asset-plugin/pull/133php
具体解决方案以下(部分操做可能须要root权限):git
$ composer global update
失败,不得已,回退到可用旧版本。github
$ composer self-update --rollback 2015-07-07_14-15-59-dbdd497
更新插件fxp/composer-asset-plugin
,听说这个1.0.3
版本解决了这个问题。json
$ composer global require "fxp/composer-asset-plugin:1.0.3"
而后composer
更新,bash
$ composer self-update $ composer global update
能够正常使用了。composer
当输入命令curl
$ sudo curl -sS https://getcomposer.org/installer | php
直接安装时,可能出现下列错误。ui
curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104 PHP Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or heredoc end (T_END_HEREDOC) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in - on line 883 Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or heredoc end (T_END_HEREDOC) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in - on line 883
我是这样解决的。url
换一种安装方式,直接下载这个https://getcomposer.org/installer, 而后用php
安装,跳过curl
这个操做。插件
$ cd /opt/lampp ## 到 https://getcomposer.org/installer 下载installer文件。 $ sudo php <path-to-installer>/installer
Changed current directory to /home/litianci/.composer ./composer.json has been updated Loading composer repositories with package information The "https://packagist.org/packages.json" 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 failedhttps://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of dateUpdating dependencies (including require-dev) Nothing to install or update Generating autoload files
我是这样解决的。
$ php -r "print_r(openssl_get_cert_locations());"
回车,能够看到相似以下的输出。
Array( [default_cert_file] => /opt/lampp/share/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /opt/lampp/share/openssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => /opt/lampp/share/openssl/private [default_default_cert_area] => /opt/lampp/share/openssl [ini_cafile] => [ini_capath] => )
在第一行看到xampp会到/opt/lampp/share/openssl/cert.pem
找验证文件。
cacert.pem
。$ cd $ wget http://curl.haxx.se/ca/cacert.pem
把文件下载到~目录下。
$ sudo mv ~/cacert.pem /opt/lampp/share/openssl/cert.pem
注意:这个/opt/lampp/share/openssl/cert.pem
要跟上面第一步找到到地址一致。
$ sudo /opt/lampp/xampp restart
问题解决。