解决PHP Warning: putenv() has been disabled for security reasons in phar:

在使用composer的时候报一下错误,这是因为php禁用了putenv() 函数

PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 97

Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 97

PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/src/Composer/Util/Platform.php on line 78

Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/src/Composer/Util/Platform.php on line 78

如果使用宝塔

就去宝塔的php配置里删掉禁用的函数putenv

修改php.ini配置

为了避免修改错误!请在修改前备份原来的putenv文件!

修改php的配置文件,php.ini

找到disable_function这个地方,把putenv去掉即可。

相关推荐
Wiktok28 分钟前
ThinkPHP框架中各模块通过MVC架构和扩展机制协同工作形成完整的请求处理流程
开源·php·mvc
拓端研究室TRL1 小时前
R软件线性模型与lmer混合效应模型对生态学龙类智力测试数据层级结构应用
开发语言·r语言
于慨2 小时前
计算机考研C语言
c语言·开发语言·数据结构
GGGGGGGGGGGGGG.2 小时前
使用dockerfile创建镜像
java·开发语言
请为小H留灯2 小时前
Python中很常用的100个函数整理
开发语言·python
达斯维达的大眼睛3 小时前
QT小项目-简单的记事本
开发语言·qt
轩宇^_^3 小时前
C++ 类与对象的实际应用案例详解
开发语言·c++
oioihoii3 小时前
从零到多页复用:我的WPF MVVM国际化实践
开发语言·c#·wpf
c7_ln3 小时前
编程视界:C++命名空间
开发语言·c++·笔记
Serendipity-Solitude4 小时前
c++中的数学函数库(少)
开发语言·c++