草庐IT

MEMORY_LIMIT_EXCEEDED

全部标签

php - Apache 崩溃 : Cannot allocate memory

我遇到了一个反复出现的问题,为什么我的ubuntu服务器在过去两天大约在同一时间变得不可用。在崩溃期间,我什至无法通过SSH连接到它。Ubuntu服务器在amazonawst2.micro实例上,运行在1gbram上,Ubuntu16.04apache错误日志如下所示[WedAug3018:02:23.7100722017][autoindex:error][pid7505][client60.191.38.77:57957]AH01276:Cannotservedirectory/var/www/html/:NomatchingDirectoryIndex(index.html,in

domdocument - PHP 命令行脚本忽略 php.ini 和 ini_set ('memory_limit' ,...) 指令

我面临常见的“fatalerror:内存不足(已分配30408704)(已尝试分配24个字节)...”PHPfatalerror。通过Apache提供的页面没有表现出这种行为。我试过以下方法:将php.ini中的memory_limit增加到一个更大的值。通过调用ini_set('memory_limit',-1),ini_set('memory_limit','-1'),在脚本中增加memory_limit>ini_set('memory_limit',100000000),ini_set('memory_limit','128M')等unset()清除不需要的数组和对象以鼓励垃圾收

PHP:意外的 PREG_BACKTRACK_LIMIT_ERROR

functionrecursiveSplit($string,$layer){$err=preg_match_all("/\{(([^{}]*|(?R))*)\}/",$string,$matches);echo"Elementitrovati:$err";if($err==FALSE)echo"preg_match_allERROR";//iteratethrumatchesandcontinuerecursivesplitif(count($matches)>1){for($i=0;$i0){echo"Layer".$layer.":".$matches[1][$i]."";rec

php - PHP memory_limit是否为PHP预分配内存

我们网站上的一些页面达到了PHP内存限制,目前设置为128MB。当请求将内存限制提高到256MB时,托管公司的工程师告诉我们:在我们的服务器上“平均请求需要不到64MB的RAM”和“将内存限制移动到256MB实质上创建了192M的内存平均分配,大多数请求都不会使用它”memory_limit数量实际上是预先分配的,并且192MB将被浪费用于我们的大部分请求,这是否正确?谢谢! 最佳答案 发件人:http://php.net/manual/en/ini.core.php#ini.memory-limitThissetsthemaxim

php - 如何使用 php ://memory file handle? 执行 cURL PUT 请求

我正在使用第3方PHP类来访问API,它具有以下代码:$fh=fopen('php://memory','w+');fwrite($fh,$xml);rewind($fh);$ch=curl_init($req->to_url());curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($ch,CURLOPT_PUT,true);curl_setopt($ch,CURLOPT_INFILE,$fh);在最后一行,即这一行:curl_setopt($ch,CURLOPT_INFILE,$fh);我收到错误:Warning:cu

php - fatal error : Allowed memory size of 134217728 bytes exhausted (tried to allocate 3 bytes) after ini_set

一开始,我已经看了this,this和this.我收到以下错误:Fatalerror:Allowedmemorysizeof134217728bytesexhausted(triedtoallocate220bytes)我正在使用php5.4和sqlAnywhere11.这个问题的解决方案是根据this正在放ini_set('memory_set',-1);在我的php-file,但在这样做之后我得到另一个错误:Fatalerror:Allowedmemorysizeof134217728bytesexhausted(triedtoallocate3bytes)编辑:我的代码是我希望有

php - "php --help"在 Ubuntu 上导致 "PHP memory exhausted"错误

PHPfatalerror:第0行未知中允许的262144字节的内存大小耗尽(试图分配523800字节)“php5--help”也会发生同样的事情我已经研究过这个并且读到我应该:1)增加php.ini中的内存限制-在php.ini的所有实例中都是128MB-应该足以运行phpclihelp2)提高脚本的内存效率——显然不适用于--help如果可以请帮忙? 最佳答案 检查PHPCLI的php.ini文件(/etc/php5/cli/php.ini)。确保memory_limit声明设置了单位:memory_limit=32M不是mem

php - 使用 php ://memory wrapper causes errors

我正在尝试通过添加一种方法来扩展Worx的PHP邮件程序类,该方法允许我使用字符串数据而不是文件路径来添加附件。我想到了这样的事情:publicfunctionaddAttachmentString($string,$name='',$encoding='base64',$type='application/octet-stream'){$path='php://memory/'.md5(microtime());$file=fopen($path,'w');fwrite($file,$string);fclose($file);$this->AddAttachment($path,$

php - fatal error : Maximum execution exceeded

我正在尝试将大型数据库导入我的WAMP2.5服务器phpmyadmin。导入一些表后出现错误:Fatalerror:Maximumexecutiontimeof360secondsexceededinC:\wamp\apps\phpmyadmin4.1.14\libraries\dbi\DBIMysqli.class.phponline285导入过程停止。我已经在我的php.ini文件中增加了max_execution_time。谁能帮我解决这个问题? 最佳答案 不要修改php.ini文件!修改phpMyAdmin文件的别名:J:\

php - 使用 createQueryBuilder 在 doctrine2 中使用 LIMIT ( setMaxResults ) 更新查询不起作用

我有以下代码$qb=$this->createQueryBuilder('cs')->update()->set('cs.is_active',1)->where('cs.reward_coupon=:reward_coupon')->setMaxResults($limit)->setParameter('reward_coupon',$rewardCoupon);$qb->getQuery()->execute();这不会在结果查询中应用LIMIT。 最佳答案 setMaxResult()必须是你最后的Doctrine语句才能正