1

我正在使用禁用以下 php 功能的免费网络托管平台:allow_url_fopen, fsockopen, pfsockpen, getrusage, get_current_user, set_time_limit, getmyuid, getmypid, dl, leak, listen, chown, chgrp, realpath, link, exec, passthru, curl_init.

这些功能被禁用意味着我不能使用 curl 或 fsockopen 与外部服务器通信。

我已经尝试使用这里file_get_contents提到的,但我收到以下错误消息:file_get_contents(): Unable to find the wrapper https - did you forget to enable it when you configured PHP?

由于我正在使用免费托管计划,我不知道我可以进行任何 php 配置。与外部服务器通信是否还有其他选项?

4

2 回答 2

2

您似乎正在使用免费帐户,这是您的主机对非付费帐户的限制,或者您没有要求他们在您的付费帐户上启用传出通信。

来自awardspace.com 常见问题解答:(粗体感兴趣的区域)

15、我不能在我的网站上使用 RSS feeds 或 cURL?

默认情况下,所有帐户都禁用传出连接,但可以根据要求为付费帐户启用它们。因此,您需要做的就是从您的主机控制面板 -> 支持中心 -> 故障单提出一张票,我们将为您启用它们。

于 2013-08-23T19:51:22.497 回答
2

file_get_contents 可能是您最好的选择。根据您作为免费用户获得的权限,您可以尝试从代码中设置 php.ini,该代码仅适用于该脚本。

http://php.net/manual/en/function.ini-set.php

因此,要解决 Unable to find the wrapper https 错误,您可以尝试

ini_set('extension', 'php_openssl.dll');
ini_set('allow_url_include', 'on');
于 2013-08-23T19:54:08.057 回答