简体   繁体   English

php cURL发布超出执行时间问题

[英]php cURL post exceed execution time issue

I've asked about this before but didn't explain myself quite well. 我之前曾问过这个问题,但并没有很好地解释自己。

Point is I've been working with cURL post requests and had no problem till now. 重点是我一直在处理cURL发布请求,到目前为止没有任何问题。

I'm trying to send a post request from my remote server: 我正在尝试从远程服务器发送发布请求:

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

$file is a select query from database encrypted with openssl_encrypt and then encoded into base64 $ 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);

but only thing I receive is 但我唯一收到的是

PHP Fatal error : Maximum execution time of 30 seconds exceeded

NOTE: 注意:

On previous cases what I did was sent a request to local server and retrieving information [ mysqli select query ] to put into my remote server and it worked well with no errors or warnings. 在以前的情况下,我所做的工作是向本地服务器发送了一个请求,并检索信息[ mysqli select query ]放入我的远程服务器,并且它运行良好,没有错误或警告。

But know that I'm trying to send information from remote server to local and It's giving me the problems I mentioned before. 但是知道我正在尝试将信息从远程服务器发送到本地,这给了我前面提到的问题。

Does anyone know how to solve this? 有谁知道如何解决这个问题?

UPDATE: 更新:

The Maximum execution time exceeded error line is the same as 最大执行时间超出错误行与

$result = curl_exec($ch);

Does this mean that the problem could be on the external script? 这是否意味着问题可能出在外部脚本上?

You should check whether you local or your remote server displays the message and then increase the max_execution_time on that system to some higher value than 30 seconds. 您应该检查本地远程服务器是否显示该消息,然后将该系统上的max_execution_time增加到比30秒更高的值。 I don't think that this is related to cURL in any way 我认为这与cURL没有任何关系

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM