php cURL 帖子超过执行时间问题



我以前问过这个问题,但没有很好地解释自己。

关键是我一直在使用 cURL 发布请求,到目前为止没有任何问题。

我正在尝试从远程服务器发送发布请求:

$file = json_encode($mysqli_select_query);
$file = openssl_encrypt($file, 'AES-256-CBC', $key, 0, $iv);
$file = base64_encode($file);

$file是从使用 openssl_encrypt 加密的数据库中选择查询,然后编码为 base64

$array = array(
'file' => $file,
'action' => 1,
);
$array = http_build_query($array);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://domain_name.com/absolute/path/to/script.php');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $array);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);

但我唯一收到的是

PHP Fatal error : Maximum execution time of 30 seconds exceeded

注意:

在以前的情况下,我所做的是向本地服务器发送请求并检索信息 [mysqli select query] 以放入我的远程服务器,它运行良好,没有错误或警告。

但是要知道我正在尝试将信息从远程服务器发送到本地服务器,这给了我之前提到的问题。

有谁知道如何解决这个问题?

更新:

超出的最大执行时间错误行与

$result = curl_exec($ch);

这是否意味着问题可能出在外部脚本上?

您应该检查本地服务器或远程服务器是否显示该消息,然后将该系统上的max_execution_time增加到高于 30 秒的值。我不认为这与cURL有任何关系

最新更新