解决perl: warning: Setting locale failed错误

在给CentOS linux 上的php 编译插件时遇到如下问题
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “c”
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 = “c”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).

Annoying “perl: warning: Setting locale failed”

解决办法

1. Edit your user bash_profile

vi .bash_profile

2. Insert the following:

export LANGUAGE=en_US.UTF-8

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

3. Rerun your Bash Profile

. ~/.bash_profile

在AWS上执行 Perl Cpan命令,出现 Can not locate CPAN.pm in @INC错误

Rather than trying to build the perl modules from CPAN, just use:
出现这个问题,只需要执行下面这个命令:

yum -y install perl-CPAN
sudo yum -y install perl-Digest-SHA perl-URI perl-libwww-perl perl-MIME-tools perl-Crypt-SSLeay perl-XML-LibXML

命令执行后,提示的安装内容如下:

  Installing     : perl-Compress-Raw-Zlib-2.023-119.el6_1.1.x86_64               1/17 
  Installing     : perl-XML-NamespaceSupport-1.10-3.el6.noarch                   2/17 
  Installing     : perl-IO-Compress-Base-2.020-119.el6_1.1.x86_64                3/17 
  Installing     : perl-XML-SAX-0.96-7.el6.noarch                                4/17 
  Installing     : 1:perl-XML-LibXML-1.70-5.el6.x86_64                           5/17 
  Installing     : perl-IO-Compress-Zlib-2.020-119.el6_1.1.x86_64                6/17 
  Installing     : perl-Compress-Zlib-2.020-119.el6_1.1.x86_64                   7/17 
  Installing     : perl-HTML-Tagset-3.20-4.el6.noarch                            8/17 
  Installing     : perl-HTML-Parser-3.64-2.el6.x86_64                            9/17 
  Installing     : perl-Convert-BinHex-1.119-10.1.el6.noarch                    10/17 
  Installing     : perl-IO-stringy-2.110-10.1.el6.noarch                        11/17 
  Installing     : 1:perl-TimeDate-1.16-11.1.el6.noarch                         12/17 
  Installing     : 1:perl-Digest-SHA-5.47-119.el6_1.1.x86_64                    13/17 
  Installing     : perl-Crypt-SSLeay-0.57-16.el6.x86_64                         14/17 
  Installing     : perl-MailTools-2.04-4.el6.noarch                             15/17 
  Installing     : perl-MIME-tools-5.427-4.el6.noarch                           16/17 
  Installing     : perl-libwww-perl-5.833-2.el6.noarch                   

问题解决

Refrence(参考文档): https://forums.aws.amazon.com/message.jspa?messageID=225884