[英]Error while installing Laravel Horizon on Windows
In Windows 10 Home Basic I get the following error while installing Laravel Horizon.在 Windows 10 Home Basic 中,我在安装 Laravel Horizon 时收到以下错误。
I have PHP version 7.1.9 running on Xampp.我在 Xampp 上运行 PHP 7.1.9 版。
$ composer require laravel/horizon
Your requirements could not be resolved to an installable set of packages.无法将您的要求解析为一组可安装的软件包。
Problem 1 : - laravel/horizon v1.0.8 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.问题 1: - laravel/horizon v1.0.8 需要 ext-pcntl * -> 系统中缺少请求的 PHP 扩展 pcntl。
This error indicates that the PCNTL PHP extension is not installed, and that Horizon requires a PHP environment that provides this extension.此错误表示未安装PCNTL PHP 扩展,Horizon 需要提供此扩展的 PHP 环境。
The PCNTL extension provides an API for Unix-style process management and signaling. PCNTL 扩展为 Unix 风格的进程管理和信号提供了一个 API。 Because of its inherent focus on facilities only available in Unix- or Linux-like operating systems, this extension does not support Windows as described in the documentation :由于其固有的专注于仅在类 Unix 或类 Linux 操作系统中可用的设施,因此此扩展不支持文档中所述的 Windows:
Note: This extension is not available on Windows platforms.注意:此扩展在 Windows 平台上不可用。
From this API, Laravel Horizon uses the async signal handling feature that's new to PHP 7.1 to manage queue worker processes.通过这个 API,Laravel Horizon 使用 PHP 7.1 新的异步信号处理功能来管理队列工作进程。 For this reason, Horizon does not currently support Windows, and Windows developers need to use a virtual environment, such as Homestead , to install and run Horizon.为此,Horizon 目前不支持 Windows,Windows 开发者需要使用Homestead等虚拟环境来安装和运行 Horizon。
At the time of writing, this reflects the official position of the Laravel team regarding this issue.在撰写本文时,这反映了 Laravel 团队对此问题的官方立场。
Add "laravel/horizon": "^4.0", in composer.json and for install Horizon run command添加 "laravel/horizon": "^4.0", 在 composer.json 和安装 Horizon 运行命令
composer install --ignore-platform-reqs
For start Horizon in windows you can use command要在 Windows 中启动 Horizon,您可以使用命令
php artisan queue:listen --queue=default,horizon
Go to composer.json
and under config
, add this转到composer.json
并在config
下添加
"platform": {
"ext-pcntl": "8.0",
"ext-posix": "8.0"
}
So, from the next time, you won't have to use --ignore-platform-reqs
anymore.因此,从下一次开始,您将不必再使用--ignore-platform-reqs
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.