Php 操作在20001毫秒后超时,接收到0字节(最佳微调器API)

Php 操作在20001毫秒后超时,接收到0字节(最佳微调器API),php,curl,dedicated-server,Php,Curl,Dedicated Server,在我的服务器上运行时,我遇到了一个关于最佳API的问题,我遇到了这个错误 请求超时 此请求处理时间太长,服务器已超时。如果不应超时,请联系此网站的管理员以增加“连接超时” 即使我正在使用此设置时间限制(0) 微调器不会返回任何微调内容 以下是我正在使用的: <?php function curl_post($url, $data, &$info){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl

在我的服务器上运行时,我遇到了一个关于最佳API的问题,我遇到了这个错误

请求超时

此请求处理时间太长,服务器已超时。如果不应超时,请联系此网站的管理员以增加“连接超时”

即使我正在使用此设置时间限制(0)

微调器不会返回任何微调内容

以下是我正在使用的:

<?php
function curl_post($url, $data, &$info){

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, curl_postData($data));
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_REFERER, $url);
  $html = trim(curl_exec($ch));
  curl_close($ch);

  return $html;
}

function curl_postData($data){

  $fdata = "";
  foreach($data as $key => $val){
    $fdata .= "$key=" . urlencode($val) . "&";
  }

  return $fdata;



 }

   set_time_limit(0);    
$url = 'http://thebestspinner.com/api.php';

#$testmethod = 'identifySynonyms';
$testmethod = 'replaceEveryonesFavorites';


# Build the data array for authenticating.

$data = array();
$data['action'] = 'authenticate';
$data['format'] = 'php'; # You can also specify 'xml' as the format.

# The user credentials should change for each UAW user with a TBS account.

$data['username'] = 'your@useremail.com';
$data['password'] = 'password';

# Authenticate and get back the session id.
# You only need to authenticate once per session.
# A session is good for 24 hours.
$output = unserialize(curl_post($url, $data, $info));

if($output['success']=='true'){
  # Success.
  $session = $output['session'];

  # Build the data array for the example.
  $data = array();
  $data['session'] = $session;
  $data['format'] = 'php'; # You can also specify 'xml' as the format.
  $data['text'] = '<p>Google today reminded everyone just how far it has come by not just releasing a video that shows off what the company has accomplished over the years since its inception, but also redesigning its logo so that it looks altogether more flat, presumably to follow suit with how interfaces and logos seem to look in 2015. The video, by the way, is well worth a watch if you find yourself forgetting just what Google has contributed to the world of search and information technology. You may be frightened of the information it holds, but there’s no doubting Google’s technical prowess.</p> <p>If you’re using an Android smartphone and want to celebrate the evolution of Google, then you might want to check out this customized boot animation&nbsp;that has cropped up on <em>Android&nbsp;Forums</em>. Installing it is a relatively simple affair, and we’re going to take you through it step by step. There are a number of&nbsp;ways to go about installing it; we’ve picked the simplest one that applies to most&nbsp;devices.</p> <p><img width="600" height="320" alt="Google-Evolved-logo-bootanimation-Android" src="http://cdn.redmondpie.com/wp-content/uploads/2015/09/Google-Evolved-logo-bootanimation-Android.jpg" style="margin: 0px auto; display: block;" class="aligncenter size-full wp-image-194470" scale="0"></p> <p>Here’s what you need to do get the ‘Google Evolved’ boot animation onto your device:</p> <p>Step 1: Install a root file explorer to your phone if you don’t already have one. Free options like ES File Explorer can be downloaded from the Play Store.</p> <p>Step 2: Launch the file explorer app and navigate to the&nbsp;<i>/system/media&nbsp;</i>directory. Copy the&nbsp;‘bootanimation.zip’ file inside and paste it to another folder. This is optional, but it’s always worth having a backup just in case the worst was to happen.</p> <p>Step 3: Download the ‘Google Evolved’&nbsp;bootanimation.zip to your phone from here.</p> <p>Step 4: Copy the downloaded file from the Downloads folder,&nbsp;paste it&nbsp;to&nbsp;<i>/system/media</i>, allowing the file explorer to overwrite the existing file. Remember, this directory isn’t the same for all devices. You might have to look up where your&nbsp;device’s bootanimation directory is.</p> <p>Step 5: Once the file is copied over, make sure that&nbsp;its permissions are set to 0644. Note that copying to root directories requires root access. If your device isn’t rooted, and you have the Android SDK set up on your computer, you can use ADB to push the bootanimation.zip file from your computer&nbsp;to the <em>/data/local&nbsp;</em>directory.</p> <p>Step 6: Reboot your device and you’re set!</p> <p><img width="599" height="322" alt="Ikbdtml" src="http://cdn.redmondpie.com/wp-content/uploads/2015/09/Ikbdtml.gif" style="margin: 0px auto; display: block;" class="aligncenter  wp-image-194471" scale="0"></p> <p>The other two ways to get the boot animation involve flashing a ZIP file using a custom recovery like ClockworkMod or TWRP and installing an APK file via&nbsp;the&nbsp;CyanogenMod Theme Engine. The latter is the easiest method of the lot, but you will need to have CyanogenMod installed, or any other AOSP&nbsp;custom ROM that includes&nbsp;the aforementioned theme engine.</p> <p><em>(via: Reddit)</em></p> <p>You may also like to check out:</p> <ul> <li>Download Android 6.0 Marshmallow Launcher, Wallpapers, Boot Animation For Any Device</li> </ul> <p>You can follow us on&nbsp;Twitter, add us to your circle on&nbsp;Google+&nbsp;or like our&nbsp;Facebook page&nbsp;to keep yourself updated on all the latest from Microsoft, Google, Apple and the web.</p> </div>';
  $data['action'] = $testmethod;
  $data['maxsyns'] = '3'; # The number of synonyms per term.

  if($testmethod=='replaceEveryonesFavorites'){
    # Add a quality score for this method.
    $data['quality'] = '1';
  }

  # Post to API and get back results.
  $output = curl_post($url, $data, $info);
  $output = unserialize($output);

  # Show results.
  echo "<p><b>Method:</b><br>$testmethod</p>";
  echo "<p><b>Text:</b><br>$data[text]</p>";

  $data['action'] = 'apiQuota';
  $quota = curl_post($url, $data, $info);
  $quota = unserialize($quota);

  if($output['success']=='true'){
    echo "<p><b>Output:</b><br>" . str_replace("\r", "<br>", $output['output']) . "</p><p>Remaining quota: $quota[output]</p>";
  }
  else{
    echo "<p><b>Error:</b><br>$output[error]</p>";
  }
}
else{
  # There were errors.
  echo "<p><b>Error:</b><br>$output[error]</p>";
}
?>

还有一件事我注意到,当我删除50%的文本时,它工作了。还有一件事我注意到,当我删除50%的文本时,它工作了
http://technews4u.net/apiexample.php