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
問題解決。