Skip to main content

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

Report an error when using composer. This is because PHP has disabled the putenv() function.

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

If using BT Linux Panel

Just go to BT Linux Panel PHP configuration and delete the disabled function putenv.

Modify php.ini configuration

To avoid modification errors! Please back up the original file before modifying it putenv! Modify the php configuration file, php.ini find the disable_function place, and remove putenv.