在宝塔安装composer,出现 putenv() has been disabled for security reasons
PHP Warning: putenv() has been disabled for security reasons in phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 149Warning: putenv() has been disabled for security reasons in phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 149PHP Warning: putenv() has been disabled for security reasons in phar:///usr/local/bin/composer/bin/composer on line 57Warning: putenv() has been disabled for security reasons in phar:///usr/local/bin/composer/bin/composer on line 57
方法一:
打开配置文件php.ini,找到disable_functions字符串,把后面的putenv删除即可正常安装。
方法二:
宝塔面板的话,我的版本是7.2,就找到 PHP7.2管理→禁用函数→删除putenv,重载配置文件后即可正常安装
方法三:多版本PHP共存的处理
按上面操作后错误还在,你就要查看服务器上是不是还安装了其他PHP版本,
宝塔面板是支持多版本PHP共存的,所以你需要把别的版本PHP的 “putenv” 也删掉。