我已经在本地系统中安装了elasticsearch(Version6.4)。我必须通过composer安装这软件包。它安装得很完美,但最后,我得到了一个错误
从锁文件加载包含包信息、安装依赖项(包括require)的composer存储库,不需要安装或更新,生成优化的自动加载文件Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan包 Elasticsearch\Common\Exceptions\InvalidArgumentException :无法解析/var/www/html/renthisto/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ClientBuilder.php:669的URI 665 x{ $parts = parse_url($host); 667 x 668\ if ($parts === false) { 抛出新的InvalidArgumentException(“无法解析URI"); 670 x} 671 x 672\ if (isset($parts‘’port) !== true) { 673美元部分港口=9200美元; 异常跟踪: 1个Elasticsearch\ClientBuilder::extractURIParts("http://") /var/www/html/renthisto/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ClientBuilder.php:625 2个Elasticsearch\ClientBuilder::buildConnectionsFromHosts() /var/www/html/renthisto/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ClientBuilder.php:562 请使用参数-v查看更多细节。Script @php artisan包:发现如何处理错误代码1返回的后自动转储事件。
这是我的作曲家档案
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"doctrine/dbal": "^2.8",
"elasticsearch/elasticsearch": "^6.0",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"jenssegers/mongodb": "^3.4",
"laravel/framework": "5.6.*",
"laravel/passport": "^7.0",
"laravel/tinker": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true}
我没有找到任何解决办法。我有以下版本(PHP-7.2) (Laravel-5.6) (ElasticSear-6.4)在我的本地系统中。提前谢谢。
发布于 2018-10-18 05:21:34
在service.php配置文件中,替换主机为我工作。
以前(其中搜索主机为"localhost:9200")
'search' => [
'enabled' => env('SEARCH_ENABLED', false),
'hosts' => explode(',', env('SEARCH_HOST')),
]在更换主机后,它起了作用。
'search' => [
'enabled' => env('SEARCH_ENABLED', false),
'hosts' => ['127.0.0.1'],
]https://stackoverflow.com/questions/52852806
复制相似问题