今天跪在这了在网上找了很多,涨知识
最近为了测试drupal8的commerce2模块,不得不去了解和使用composer,原因是commerce2模块的依赖模块address必须通过composer来安装依赖库,经过一番折腾总算在ubuntu上安装好composer,可在使用的时候提示[ErrorException]proc_get_status() has been disabled for security reasons(如图):
从错误提示信息中可以看到是因为关闭了PHP的proc_get_status()函数,那么如何解决这个问题呢?
打开php.ini文件,搜索 disable_functions,找到如下类似内容:
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,如图:
这个是缺少了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_get_status() 和proc_open这两个PHP函数。
转自:徐江伟博客:https://www.tuhongwei.com/web/414