putenv() has been disabled for security reasons linux下执行composer命令报错

在linux面板上执行composer相关命令报如下错误:

原因是安装的php版本禁止了以下敏感函数的操作,linux面板或者lnmp环境当中

找到php.ini配置文件,把需要用的函数删除或全部删除即可

linux下可执行whereis php.ini进行查找

disable_functions = passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

删除或屏蔽后执行成功

掉坑许久,以此记录,欢迎指点

发布了49 篇原创文章 · 获赞 6 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/cmj8043719242/article/details/101099164