首页系统运维Linux系统 宝塔安装composer,出现 putenv() has been disabled for security reasons

[复制链接] |主动推送
查看48 | 回复0 | 2024-9-11 18:15:29 | 显示全部楼层 |阅读模式
在宝塔安装composer,出现 putenv() has been disabled for security reasons
162752exd3c2p3h2n8cxfi.png
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删除即可正常安装。
162753bhl4hmz4lqa9omaa.png
方法二:
宝塔面板的话,我的版本是7.2,就找到 PHP7.2管理→禁用函数→删除putenv,重载配置文件后即可正常安装
162753kmlfe1zxjdjtthyi.png
方法三:多版本PHP共存的处理
按上面操作后错误还在,你就要查看服务器上是不是还安装了其他PHP版本,
宝塔面板是支持多版本PHP共存的,所以你需要把别的版本PHP的 “putenv” 也删掉。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则