PHP中的openssl_seal生成“ 503服务不可用”页面

问题描述

因此,来自付款处理程序的库开始显示503页的空白。我将问题缩小为一个openssl_seal电话。为简化起见,我改编并运行了openssl_seal手册页中的示例,它还在该服务器上抛出503页,而在另一台服务器上运行良好。这是代码

<?PHP
  $certPath='public.cer';

  $data = "This is top secret.";
  $cert = file_get_contents($certPath);

  $pk1 = openssl_get_publickey($cert);
  $iv = openssl_random_pseudo_bytes(32);

  $publicKey = openssl_pkey_get_public("file://{$certPath}");
  $publicKeys = array($publicKey);

  openssl_seal($data,$sealed,$ekeys,$publicKeys); // throws a 503 on one server,works fine on another

  openssl_free_key($pk1);
  echo base64_encode($sealed);
?>

两台服务器上的PHP版本均为5.6.40。

它可以在服务器上运行而不是在另一台服务器上运行,这一事实使我相信这是我应该与托管公司联系的事情,但是我的专业知识超出了我所不知道的范围在哪里寻找问题或要求什么。有什么想法吗?

解决方法

我也面临着同样的问题。它是通过修改.htaccess文件修复的。 尝试将以下代码添加到.htaccess文件中:

<IfModule lsapi_module><FilesMatch "\.(php|php4|php5|php7|phtml)$">
    SetHandler application/x-httpd-alt-php55___lsphp
  </FilesMatch></IfModule>