Question

i have a silly problem when migrating from localhost to AWS ec2. nginx web server with php 5.5 and mcrypt installed on both environment.

on localhost crypt function works but on remote server it ends on 404 error page.

some pieces of the code...

called function from the web page:

  $crypt = new crypt();

        // encrypt the 
        // 
        $id='abcdefght';
        $to='12345678';

        $encoded = $crypt->encrypt( $id.','.$to);
        echo $encoded."\n";

crypt class

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 );
}

i don't understand if there is some timeout on nginx or if i need to install something more...

thanks for the help

Was it helpful?

Solution 2

i have solved using a different function for the crypt...

public  function encrypt($value){ 
if(!$value){return false;}
$text = $value;
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->skey, $text, MCRYPT_MODE_ECB, $iv);
return trim($this->safe_b64encode($crypttext)); 
}

this one is running fine without touching the fastCgi timing.

thanks for the support.

OTHER TIPS

This might be due to some issue preventing the FastCGI server to respond in a reasonable time. Try extending the read timeout and see if the real problem shows.

See Connection timed out while reading response header and Module ngx_http_fastcgi_module.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top