自己摸索出来的:
# $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->key, $input, MCRYPT_MODE_CBC, $iv);
$encrypted = openssl_encrypt($input, ‘AES-128-CBC’, $this->key, OPENSSL_RAW_DATA, $iv);
网上看到的,很好的方案:https://gist.github.com/odan/c1dc2798ef9cedb9fedd09cdfe6e8e76