Install or enable PHP‘s pcntl extension.

编程入门 行业动态 更新时间:2024-10-16 18:24:35

Install or <a href=https://www.elefans.com/category/jswz/34/1764137.html style=enable PHP‘s pcntl extension."/>

Install or enable PHP‘s pcntl extension.

问题原因:

laravel项目执行 composer install时报错,报错信息如下:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.Problem 1- hhxsv5/laravel-s is locked to version v3.7.0 and an update of this package was not requested.- hhxsv5/laravel-s v3.7.0 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension.To enable extensions, verify that they are enabled in your .ini files:- /etc/php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-pcntl` to temporarily ignore these required extensions.

google 结果:Process Control support in PHP is not enabled by default. You have to compile the CGI or CLI version of PHP with --enable-pcntl configuration option when compiling PHP to enable Process Control support.

大意就是这个配置默认是不被开启的,需要在编译php的时候使用 --enable-pcntl 参数开启

从.3.22版本源码在本地mac上编译,结果编译过程报错;后续原因没有继续追查,感觉以目前认知解决比较困难;

因此整理了一下比较不需要底层信息的解决方式:

仅针对mac 且 php version = 7.3

具体操作如下:

1.使用brew search php 查找brew 支持的php版本

2.执行brew install php@7.3

        如果执行报错:那么google php 第三方brew资源库

        执行brew tap shivammathur/php

        重新brew search

        注:shivammathur/php 是我当时搜到的可用的资源

3.将brew install 之后的php@7.3添加到环境变量中

        export PATH="/usr/local/opt/php@7.3/bin:$PATH"

        export PATH="/usr/local/opt/php@7.3/sbin:$PATH"

        export LDFLAGS="-L/usr/local/opt/php@7.3/lib"

        export CPPFLAGS="-I/usr/local/opt/php@7.3/include"

4.使用php -v验证添加之后的php版本信息

5.再次执行composer install显示成功

其中遇到的问题:使用这个第三方库安装php@7.0 直接执行php命令报错;安装php@7.3可用

更多推荐

Install or enable PHP‘s pcntl extension.

本文发布于:2024-02-24 15:41:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1695806.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:enable   Install   PHP   extension   pcntl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!