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

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,如图:

:[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函数。

猜你喜欢

转载自blog.csdn.net/qq_36264795/article/details/83552543