今天跪在這了在網上找了很多,漲知識
最近為了測試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