Composer 异常 [Symfony\Component\Process\Exception\RuntimeException]

2019-11-25 17:39 By "Powerless" 4924 0 1

    近日在服务器上使用Composer安装第三方扩展发生异常:

[root@wzxaini9 /]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi


  [Symfony\Component\Process\Exception\LogicException]
  The Process class relies on proc_open, which is not available on your PHP installation.


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

    经查,原因是在PHP升级后未开启proc_open扩展。

    进入php.ini文件找到 disable_functions 这一段,从中删除 proc_open 后保存退出

[root@wzxaini9 /]# vim /usr/local/php/etc/php.ini
......
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
......

    接下来重启一下PHP服务就可以了

评 论

View in WeChat

Others Discussion

  • PHP扩展ImageMagick安装
    Posted on 2022-11-11 11:16
  • Redis各种数据类型的使用场景举例分析【三】
    Posted on 2018-11-22 17:00
  • TCP协议的特性
    Posted on 2019-04-26 16:46
  • 前端知识体系精简-Css
    Posted on 2018-03-28 18:34
  • 一些常见的基础概念
    Posted on 2018-11-28 19:10
  • MySQL事务介绍
    Posted on 2019-06-05 18:14
  • 程序员年中考试题-段子版
    Posted on 2021-06-23 15:57
  • BASE原则
    Posted on 2020-12-17 16:42