Home  >  Article  >  Backend Development  >  nginx-Can't convert string from UTF8 to native encoding

nginx-Can't convert string from UTF8 to native encoding

WBOY
WBOYOriginal
2016-06-02 11:29:10952browse

nginx后台svnwebphp

svn: Can't convert string from 'UTF8' to native encoding
在centos使用nginx时遇到一个问题,我再nginx配置的web目录中写一个
index.php文件,内容:
exec(“./test.sh”, $out, $res);
print_r($out);
?>
test.sh内容:

<code>​cd tmp ​rm -rf *  ​svn co svn_path --username username --password passwd .</code>

然后在浏览器中访问配置的域名,svn仓库中有中文名就会出现上面的问题,但是在centos中直接使用svn命令没问题,在终端中执行 php index.php也没有问题,在终端中执行curl URL会出上述问题,所以基本可以肯定是nginx的配置问题,网上说的设置系统编码为en_US.utf-8和zh_CN.utf-8还有gb2312,gbk这些方法都试过了,在nginx中charset配置为gbk,gb2312,utf-8也试过了,求助大神帮忙,如果是nginx配置问题希望能提供一份配置我的nginx php页面解析配置为:

location ~.php$ {

<code>​include fcgi.conf;​fastcgi_pass 127.0.0.1:9000;​fastcgi_index index.php;​expires off;</code>

}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn