【发布时间】:2014-02-14 23:55:24
【问题描述】:
从 localhost 迁移到 AWS ec2 时,我遇到了一个愚蠢的问题。 两个环境都安装了 php 5.5 和 mcrypt 的 nginx 网络服务器。
在 localhost crypt 功能有效,但在远程服务器上它以 404 错误页面结束。
部分代码...
从网页调用的函数:
$crypt = new crypt();
// encrypt the
//
$id='abcdefght';
$to='12345678';
$encoded = $crypt->encrypt( $id.','.$to);
echo $encoded."\n";
加密类
public function encrypt( $text )
{
// add end of text delimiter
$data = mcrypt_encrypt( MCRYPT_RIJNDAEL_256, $this->key, $text, MCRYPT_MODE_ECB, $this->iv );
return base64_encode( $data );
}
我不明白 nginx 是否有超时,或者我需要安装更多的东西......
感谢您的帮助
【问题讨论】:
-
检查您的网络服务器的错误日志,404 作为错误描述没有帮助。
-
对不起,您是对的,该错误与上游超时有关... 2014/01/05 18:19:49 [error] 25253#0: *191 upstream timed out (110: Connection超时)从上游读取响应标头时,客户端:11.111.111.111,服务器:服务器,请求:“GET /?controller=test&action=crypt HTTP/1.1”,上游:“fastcgi://unix:/var/run/ php5-fpm/php5-fpm.sock”,主机:“server.com”
标签: php nginx amazon-ec2 mcrypt