在 softaculous 自定义脚本中,curl_init() 会默默失败
我正在构建一个自定义的 softaculous 脚本,用于安装和激活主题以及 wordpress。为了实现这一点,我需要调用 softaculous install.php 文件:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/file.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
附加一些调试后,我发现curl_init() 函数失败。我尝试将此代码直接放入另一个文件中并通过网络调用它,效果很好,但由于某种原因,它在作为 softaculous 安装的一部分执行时失败。
非常感谢任何帮助!
I am building a custom softaculous script that installs and activates a theme along with wordpress. To accomplish this, I need to make a call out of the softaculous install.php file:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/file.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
After attaching some debugging, I found that the curl_init() function was failing. I tried taking this code and putting directly into another file and calling it via web, which works great, but for some reason it fails when executed as part of a softaculous install.
Any help is greatly appreciated!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我来自 Softaculous 团队。 Softaculous 在安装脚本时使用第 3 方 PHP 二进制文件。您能否检查一下第 3 方 PHP 二进制文件中是否启用了 cURL?
如果您仍然遇到任何问题,请向我们开具支持票证,我们将进行检查。
I am from the Softaculous team. Softaculous uses the 3rd party PHP binary while installing a script. Can you please check if cURL is enabled in the 3rd party PHP binary.
If you still face any issues please open a support ticket with us we will check it.