使用队列,加载依赖包 Composer 报错 ?

问题一:执行队列监听,不出现任何东西,发帖成功了也不显示任何东西?

php artisan queue:listen

问题二 :加载 Horizon 依赖包时出现问题。

composer require "laravel/horizon:~1.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/horizon v1.2.3 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.2.2 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.2.1 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.2.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.1.1 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.9 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.8 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.7 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.6 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.5 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.4 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.3 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.2 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.1 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - laravel/horizon v1.0.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
    - Installation request for laravel/horizon ~1.0 -> satisfiable by laravel/horizon[v1.0.0, v1.0.1, v1.0.2, v1.0.3, v1.0.4, v1.0.5, v1.0.6, v1.0.7, v1.0.8, v1.0.9, v1.1.0, v1.1.1, v1.2.0, v1.2.1, v1.2.2, v1.2.3].

Installation failed, reverting ./composer.json to its original content.

求解 大神们。。。

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
最佳答案

@Cockroack必死 你所有需要 composer 加载依赖包的地方都去虚拟机里面操作,因为虚拟机环境都有了,不需要配,在你的电脑环境下的话会报 pcntl 扩展包没有,你用的是教程的homestead?
第一步进入你之前安装的homestead目录打开虚拟机:

vagrant up

第二步进入虚拟机:

vagrant ssh

然后切到你的项目下,再加载composer依赖

5年前 评论
讨论数量: 10

the requested PHP extension pcntl is missing from your system 这提示了呀,你安装一下这个扩展,再试试,应该就可以了

6年前 评论

@Amos1st 我用的配好的homestead,那我先研究一下怎么在homestead里安装扩展

6年前 评论

@jollyson 我使用 php -m 命令 看见我的homestead里面已经装了 pcntl 扩展了的啊。

6年前 评论

@jollyson 那就是没有开启,去配置文件里开启

6年前 评论

@FMW 这个不太会了,网上的安装目录跟这个homestead 里面的不一样,进去都找不到

6年前 评论

@jollyson 好了 ,好了,我通过 vagrant ssh 进到 我的homestead里面去安装就什么都可以,不知道怎么就先识别我的mac的配置了。

6年前 评论

@jollyson 请问下你是怎么进去ssh里安装pcntl扩展的?
我的是Windows系统,是不是不支持这个扩展,有救吗?

5年前 评论

@Cockroack必死 你所有需要 composer 加载依赖包的地方都去虚拟机里面操作,因为虚拟机环境都有了,不需要配,在你的电脑环境下的话会报 pcntl 扩展包没有,你用的是教程的homestead?
第一步进入你之前安装的homestead目录打开虚拟机:

vagrant up

第二步进入虚拟机:

vagrant ssh

然后切到你的项目下,再加载composer依赖

5年前 评论

@jollyson 感谢,进入虚拟机里操作成功了!
一般情况下我都是在电脑环境下去练习,因为方便操作;刚进入ssh里操作感觉执行composer的下载速度慢了很多;

5年前 评论

windows32+phpstudy (配置 PHP7.2.9nts) 未安装 Homestead 虚拟环境,运行 $ composer require “laravel/horizon:~3.1” 报错:提示需要 ext-pcntl 扩展。

解决办法 :https://www.anttoweb.com/kb/windows-horizo... :可在 composer.json 中的 config 参数中增加以下:

“config”: {
“platform”: { “ext-pcntl”: “7.2”, “ext-posix”: “7.2”}
}

重新运行$ composer require “laravel/horizon:~3.1” 后,可以打开“http://larabbs.test/horizon/dashboard”

" class="reference-link">但是后续步骤 $ php artisan horizon用于监听,发帖后会报错:“pcntl_async_signals()”

不用理会报错,用$php artisan queue:listen 进行监听,新建话题提交后,打开“http://larabbs.com/horizon/recent-jobs”,可以看见运行成功

4年前 评论
丶simon 3年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!