请求实体太大 请求的资源 /receive.php 不允许请求数据与GET请求,或请求中提供的数据量超过容量限制。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。
以上是我从基于CURL的数据库更新中得到的错误。当SQL文件大小低于700kb时,在线更新过程正常工作。但是当SQL文件增长到1MB以上时无法更新。我知道它需要特定的设置,我不知道。我已经研究过PHP ini但它没有用。请帮帮我
?php
//for localhost: export.php
//$location is the complete exported sql file location on the local system.
$data=file_get_contents($location);
$url="www.mysite.com/receive.php";
$ch= curl_init();
$data ="sql=". $data;
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch,CURLOPT_URL,$url);
$feedback = curl_exec($ch);
?>
<?php
// for remote server: receive.php
$dbhost = 'localhost';
$dbuser = 'username';
$dbpass = 'password';
$dbname = 'databasename';
if(isset($_REQUEST['sql'])):
$link = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname,$link);
$post=$_REQUEST);
foreach($data as $record)
{
$record = ($record);
try{mysql_query($record);}catch(Exception $e){}
}
echo "<h1><font color='green'>Update Of Online Database And Back Up Successfully Done</font></h1>";
else:
echo "<h1><font color='red'>Data Update Failed</font></h1>";
endif;
$time=date("h:a:i:s");
$day=date("Y-m-d");
$ti=$day." / ".$time;
mysql_query("UPDATE last_update_tb SET update_data='$ti'")or die(mysql_error());
?>