×

解决PHP 安装扩展时发生 warning: Setting locale failed. 报错

小布 小布 发表于2020-09-11 11:04:59 浏览941 评论0

抢沙发发表评论

现象:

[root@test-1-61 redis-5.3.0]# /home/pirate/programs/php7/bin/phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

解决方法:

echo "export LC_ALL=C" >> /root/.bashrc

source /root/.bashrc