过去两周我一直在使用XAMPP表格,突然间出现了"Fatal error: Allowed memory size of 3741824 bytes exhausted (tried to allocate 8192 bytes) in C:\xampp\htdocs\the_database\1.php on line 820"
然后经过一些谷歌搜索后我才知道你可以在php.inc文件中更改内存限制的快速图片...我将它从128更改为256 ..但仍显示相同的错误..然后我将其更改为1024MB ..然后再次显示错误,如
"Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 8192 bytes) in C:\xampp\htdocs\the_database\1.php on line 820"
然后我实际上“仔细阅读”了答案,并意识到这是由某个错误造成的某种内存泄漏。
现在的问题是如何找到并消除这个错误?
ERROR显示在以下代码::
上<?php include('1.php'); ?>
<?php
$servername = "localhost";
$dbusername = "root";
$dbpassword = "*****";
$dbname = "the_database";
$addtext = $_POST['addtext'];
$date = date_default_timezone_set('Asia/Kolkata');
$date = date('d/m/Y H:i:s');
$conn = new mysqli ($servername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
VALUES ('$addtext', '$date')";
if ($conn->query($sql) === TRUE) {
echo '<script language="javascript">';
echo 'alert("Your Answer has been Succesfully posted")';
echo '</script>';
echo '<a href="answer.php"></a>';
}
else {
echo "ERROR" . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
任何帮助都会得到赞赏..