目次
回复讨论(解決策)
ホームページ バックエンド開発 PHPチュートリアル Web サイトのメモリが不足しました (エラー: 許容メモリ サイズ 134217728 バイトが使い果たされました (すべて試しました)

Web サイトのメモリが不足しました (エラー: 許容メモリ サイズ 134217728 バイトが使い果たされました (すべて試しました)

Jun 23, 2016 pm 01:28 PM

出现问题:
[Thu Jul 09 09:57:22 2015] [error] [client 183.61.51.179] PHP Fatal error: 134217728バイトの許可されたメモリサイズが使い果たされました(4を割り当てようとしました) 294967296 バイト)/vhost/vhostroot/wart8555 内/www/class/companyInfomation.php 80 行目
[2015 年 7 月 9 日木 09:57:48] [エラー] [クライアント 59.57.252.98] PHP 致命的エラー: 134217728 バイトの許容メモリ サイズが使い果たされました (4 を割り当てようとしました) 294967296 バイト) /vhost/vhostroot/wart8555/www/class/companyInfomation.php のオンライン 80
[2015 年 7 月 9 日木 09:57:50] [エラー] [クライアント 59.57.252.98] ファイルが存在しません: /vhost/vhostroot/wart8555 /www/favicon.ico
[Thu Jul 09 10:01:38 2015] [エラー] [クライアント 59.57.252.98] PHP 致命的エラー: 134217728 バイトの許容メモリサイズが使い果たされました (4294967296 バイトを割り当てようとしました) )/vhost/vhostroot 内/wart8555/www/class/companyInfomation.php on line 80
首先index.php中引用foot.php页面、里面出现了问题、初学PHP、请大神帮忙看下

<?php  include 'include.php';include ROOT_PATH . '/tool/Page.php';include ROOT_PATH . '/tool/Database.php';include ROOT_PATH.'/class/baseProduct.php';include ROOT_PATH.'/class/baseInformation.php';//产品list$baseProduct = new BaseProduct();$productList = $baseProduct->indexShow();$information = new BaseInformation();$infor_list = $information->findPage(1, 5);?><!DOCTYPE html><head><title><?php echo WEB_TITLE;?></title><meta charset="UTF-8"><link rel="stylesheet" href="css/foundation.min.css"><link rel="stylesheet" href="css/superfish.css"><link rel="stylesheet" href="css/stylesheet.css"><link rel="stylesheet" href="js/slider/flexslider.css"><link rel="stylesheet" href="js/slider/flexcar.css"><link href='css/defult.css' rel='stylesheet' type='text/css'><script src="js/vendor/custom.modernizr.js"></script><script>Modernizr.load({    // test if browser understands media queries    test: Modernizr.mq('only all'),    // if not load ie8-grid    nope: 'css/ie8-grid-foundation-4.css'});</script><!--[if lt IE 9]><link rel="stylesheet" href="css/ie-fixes.css"><![endif]--></head><body><div class="header">  <?php include ROOT_PATH.'/top.php';?>  <div class="slider">      </div></div><div class="tagline">  <div class="row">    <div class="columns large-12">      <div class="center">		<div class="columns large-4 large-offset-1 content sidebar" id="youkuplayer" style="float: left; width: 370px;height: 241px; margin-left: 0"></div>		<script type="text/javascript" src="http://player.youku.com/jsapi">				player = new YKU.Player('youkuplayer',{				styleid: '0',				client_id: '9d672744e5e73950',				vid: 'XMTI3ODgyNjU4OA==',				autoplay: false,				show_related: false,				events:{					onPlayEnd: function(){ playVideo(); }					}				});				function playVideo(){					player.playVideo();					}			</script>		<div class="columns large-4 large-offset-1 content sidebar" style="float: left; margin-left: 10px;">        <h1 class="page-title services" style="font-size: 14px;text-align: left;cursor: pointer; " onclick="location.href='<?php echo ROOT_URL;?>/blog.php'">新闻</h1>        <ul>        <?php for($i=0;$i<count($infor_list);$i++){?>          <li class="bullet" style="text-align: left;"><a href="<?php echo ROOT_URL."/blog.php?id=".$infor_list[$i]["id"];?>"><?php echo $infor_list[$i]["title"].$infor_list[$i]["id"];?></a></li>        <?php }?>                  </ul>      </div>      <div></div>      </div>    </div>  </div></div><div class="service-box" style="display: none;">  <?php for($i=0;$i<count($productList);$i++){  		if($i==0){  			echo "<div class=\"row service\">";  		}elseif($i%3==0){  			echo "</div><div class=\"row service\">";  		}  		$picSrc = ROOT_URL.$productList[$i]["hostPath"]."/".$productList[$i]["saveName"];  ?>    <div class="columns large-4 sp">      <h1 class="service-subtitle sp_title"><?php echo $productList[$i]["title"];?></h1>      <p><img src="<?php echo $picSrc;?>" alt="" class="threeUp"></p>      <div> <?php echo $productList[$i]["littleContent"];?></div>      <p> <a class="button custom">详情</a> </p>    </div>  <?php if($i==count($productList)-1){  			echo "</div>";  		}  }?></div><div class="front-testimonial">  <div class="row">    <div class="columns large-12">      <div class="flexcar">          </div>  </div></div>  <?php include ROOT_PATH.'/foot.php';?><script src="js/jquery.min.js"></script><script src="js/hoverIntent.js"></script><script src="js/superfish.js"></script><script src="js/slider/jquery.flexslider.js"></script><script>Modernizr.load({    test: Modernizr.placeholder,    nope: 'js/placeholder.min.js'});function goToNewPage() {    if (document.getElementById('target').value) {        window.location.href = document.getElementById('target').value;    }}</script><script>$(document).ready(function () {    $('ul.sf-menu').superfish({        animation: {            height: 'show'        },        delay: 400    });    $("img.scrollToTop").click(function () {        $("html, body").animate({            scrollTop: 0        }, "slow");    });    $('.flexslider').flexslider();    $('.flexcar').flexslider();});</script></body></html>
ログイン後にコピー

<?phprequire_once 'include.php';require_once  ROOT_PATH.'/class/companyInfomation.php';$companyInfo_foot = new CompanyInfomation();$info_foot = $companyInfo_foot->getContent();?><footer class="footer">  <div class="row">    <div class="columns large-12 footer-inner">      <div class="row">        <div class="columns large-4 useful-links">          <div>            <h2 class="footer-title">Quick links</h2>            <ul class="footer-list">              <li><a href="#">伟达</a></li>              <li><a href="#">新闻</a></li>              <li><a href="#">产品</a></li>              <li><a href="#">视频</a></li>              <li><a href="#">下载</a></li>            </ul>          </div>        </div>        <div class="columns large-4 contact">          <div>            <h2 class="footer-title">Contactus</h2>            <ul class="footer-list">              <li><span class="small-icon"><img src="<?php echo ROOT_URL;?>/images/address.png" alt=""></span><?php echo $info_foot==null?"":$info_foot->getAddr();?></li>              <li><span class="small-icon"><img src="<?php echo ROOT_URL;?>/images/phone.png" alt=""></span><?php echo $info_foot==null?"":$info_foot->getTel();?></li>              <li><span class="small-icon"><img src="<?php echo ROOT_URL;?>/images/fax.png" alt=""></span><?php echo $info_foot==null?"":$info_foot->getFx();?></li>              <li><span class="small-icon"><img src="<?php echo ROOT_URL;?>/images/email.png" alt=""></span><?php echo $info_foot==null?"":$info_foot->getEmail();?></li>            </ul>          </div>        </div>        <div class="columns large-4 about">          <div>            <h2 class="footer-title">Aboutus</h2>            <p><img src="images/about.png" alt=""></p>            <p>Placerat urna et tristique in! Scelerisque integer nisi pha sellus, nec phasellus arcualiquet etiam magna massa sit cursus adipiscing sed, nec? Aenean odio! Cumac dolor dapibus tincidunt lorem ipsum dolor sit esmet placerat urna et tristique in! Scelerisque integer nisi phasellus</p>          </div>        </div>      </div>    </div>  </div></footer><div class="credit-row">  <div class="row">    <div class="columns large-11 credit"></div>    <div class="columns large-1"> <img src="images/toparrow.png" alt="" class="scrollToTop"> </div>  </div></div>
ログイン後にコピー
<?phpclass CompanyInfomation{	private $id;	private $infomation;	private $addr;	private $tel;	private $fx;	private $email;		function setId($id){		$this->id = $id;	}	function getId(){		return $this->id;	}	function setInfomation($infomation){		$this->infomation = $infomation;	}	function getInfomation(){		return $this->infomation;	}	function setAddr($addr){		$this->addr = $addr;	}	function getAddr(){		return $this->addr;	}	function setTel($tel){		$this->tel = $tel;	}	function getTel(){		return $this->tel;	}	function setFx($fx){		$this->fx = $fx;	}	function getFx(){		return $this->fx;	}	function setEmail($email){		$this->email = $email;	}	function getEmail(){		return $this->email;	}		function edit(){		$select_sql = "select id from company_information where id = ?";		$insert_sql = "insert into company_information (information,addr,tel,fx,email)values(?,?,?,?,?)";		$update_sql = "update company_information set information = ?,addr=?,tel=?,fx=?,email=? where id=?";		$database = new Database();		$conn = $database->getConn();		$stmt = $conn->prepare($select_sql); 		$stmt->bind_param('i',$this->id); 		$stmt->execute(); 		$stmt->bind_result($id);				$stmt_edit = null;		if($stmt->fetch()){			$stmt_edit = $conn->prepare($update_sql); 			$stmt_edit->bind_param("sssssi",$this->infomation,$this->addr,$this->tel,$this->fx,$this->email,$this->id);			$stmt_edit->execute();		}else{			$stmt_edit = $conn->prepare($insert_sql);			$stmt_edit->bind_param("sssss",$this->infomation,$this->addr,$this->tel,$this->fx,$this->email);			$stmt_edit->execute();		}		$stmt->close();		$stmt_edit->close();		$conn->close();	}		function getContent(){		$select_sql = "select id,information,addr,tel,fx,email from company_information limit 0,1";		$database = new Database();		$conn = $database->getConn();		$stmt = $conn->prepare($select_sql); 		$stmt->execute();		$stmt->bind_result($id,$information,$addr,$tel,$fx,$email);		$infomation_obj = null;		if ($stmt->fetch())		{			$infomation_obj = new CompanyInfomation();			$infomation_obj->setAddr($addr);			$infomation_obj->setEmail($email);			$infomation_obj->setFx($fx);			$infomation_obj->setId($id);			$infomation_obj->setInfomation($information);			$infomation_obj->setTel($tel);		}		$stmt->close();		$conn->close();		return $infomation_obj;	}}?>
ログイン後にコピー


回复讨论(解決策)

内部在庫が不足しています。問題が発生する前に、すべての値、パラメータを印刷します。



は、companyInfomation.php ですか?

4G が必要な場所が見つかりません

最後の 1 つは、

内部保存が不足しています。すべての量、パラメータ

最初の 104 行、2 番目の 3 ~ 5 行、3 番目の 80
は 4G 内に必要な場所を確認できませんでした。このような問題

虽然 bind_result 方法はパラメータ変更量事の必要はありませんが、事前に注意してください $id = $information = $addr = $tel = $fx = $email = '';

$stmt->bind_result($id,$information,$addr,$tel,$fx,$email);

虽然 bind_result メソッドはパラメータ数の必要はありませんが、しかし、你还是先導下比较予想

$id = $information = $addr = $tel = $fx = $email = ‘’;

$stmt->bind_result($id,$information,$addr,$tel,$fx,$email);

还是不行

你试一下不使用 bind_result 是怎样的

谢谢各位回答,字段类型设置错误,一大文本字段設置成為最大字段,需要内存4G,换了就好了

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

Laravelでフラッシュセッションデータを使用します Laravelでフラッシュセッションデータを使用します Mar 12, 2025 pm 05:08 PM

Laravelは、直感的なフラッシュメソッドを使用して、一時的なセッションデータの処理を簡素化します。これは、アプリケーション内に簡単なメッセージ、アラート、または通知を表示するのに最適です。 データは、デフォルトで次の要求のためにのみ持続します。 $リクエスト -

PHPのカール:REST APIでPHPカール拡張機能を使用する方法 PHPのカール:REST APIでPHPカール拡張機能を使用する方法 Mar 14, 2025 am 11:42 AM

PHPクライアントURL(CURL)拡張機能は、開発者にとって強力なツールであり、リモートサーバーやREST APIとのシームレスな対話を可能にします。尊敬されるマルチプロトコルファイル転送ライブラリであるLibcurlを活用することにより、PHP Curlは効率的なexecuを促進します

Laravelテストでの簡略化されたHTTP応答のモッキング Laravelテストでの簡略化されたHTTP応答のモッキング Mar 12, 2025 pm 05:09 PM

Laravelは簡潔なHTTP応答シミュレーション構文を提供し、HTTP相互作用テストを簡素化します。このアプローチは、テストシミュレーションをより直感的にしながら、コード冗長性を大幅に削減します。 基本的な実装は、さまざまな応答タイプのショートカットを提供します。 Illuminate \ support \ facades \ httpを使用します。 http :: fake([[ 'google.com' => 'hello world'、 'github.com' => ['foo' => 'bar']、 'forge.laravel.com' =>

Codecanyonで12の最高のPHPチャットスクリプト Codecanyonで12の最高のPHPチャットスクリプト Mar 13, 2025 pm 12:08 PM

顧客の最も差し迫った問題にリアルタイムでインスタントソリューションを提供したいですか? ライブチャットを使用すると、顧客とのリアルタイムな会話を行い、すぐに問題を解決できます。それはあなたがあなたのカスタムにより速いサービスを提供することを可能にします

PHPにおける後期静的結合の概念を説明します。 PHPにおける後期静的結合の概念を説明します。 Mar 21, 2025 pm 01:33 PM

記事では、PHP 5.3で導入されたPHPの後期静的結合(LSB)について説明し、より柔軟な継承を求める静的メソッドコールのランタイム解像度を可能にします。 LSBの実用的なアプリケーションと潜在的なパフォーマ

フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。 フレームワークのカスタマイズ/拡張:カスタム機能を追加する方法。 Mar 28, 2025 pm 05:12 PM

この記事では、フレームワークにカスタム機能を追加し、アーキテクチャの理解、拡張ポイントの識別、統合とデバッグのベストプラクティスに焦点を当てています。

フレームワークセキュリティ機能:脆弱性から保護します。 フレームワークセキュリティ機能:脆弱性から保護します。 Mar 28, 2025 pm 05:11 PM

記事では、入力検証、認証、定期的な更新など、脆弱性から保護するためのフレームワークの重要なセキュリティ機能について説明します。

See all articles