使用composer提示[ErrorException ]proc_get_status() has been disabled for security reasons 的解决方法

handsomeqin5年前技术1612

composer提示[ErrorException]proc_get_status() has been disabled for security reasons的解决方法

从错误提示信息中可以看到是因为关闭了PHP的proc_get_status()函数,那么如何解决这个问题呢?

打开php.ini文件,搜索 disable_functions,找到如下类似内容:路径是 /usr/local/php/etc/php.ini

disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,proc_open,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
找到proc_get_status并删除然后重启php服务。

解决上面的提示后继续使用composer又出现了新的错误提示:[Symfony\Component\Process\Exception\RuntimeException] The Process class relies on proc_open,如图:

:[Symfony\Component\Process\Exception\RuntimeException] The Process class relies on proc_open

这个是缺少了PHP的proc_open函数,解决方法同样是打开php.ini文件搜索disable_functions,删除disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server中的proc_open并重启php服务。

然后使用composer就正常了,上面两个问题可以看出用composer来安装drupal8模块需开启proc_open和proc_open这两个PHP函数。

相关文章

Gerapy Auto Extractor真好用

import jsonimport requestsfrom gerapy_auto_extractor.extractors.list import extract_list# html = ope...

Android平台签名证书(.keystore)生成指南

安装JRE环境(如已有可跳过)可从Oracle官方下载jre安装包:https://www.oracle.com/technetwork/java/javase/downloads/index.htm...

Linux–CentOS定时运行Python脚本

执行所需Linux下安装crontab符合自己需求的python脚本由于自己和公司所使用的是云服务器,均已安装crontab,所以这里略过,有需要的小伙伴可以看看此篇文章操作步骤这里有两种方法进行定时...

python自动给数字前面补0的方法

python中有一个zfill方法用来给字符串前面补0,非常有用n = "123"s = n.zfill(5)assert s&n...

voyager Laravel 配置和使用

地址: https://github.com/the-control-group/voyagerInstallation Steps1. Require the PackageAfter c...

php中正则表达式对斜杠的处理

斜杠需要加两个反斜杠 \\ 进行转义.$key = "https://file.ipadown.com/tophub/assets/images/media/appinn.com.png&q...