增加内存限制 [英] Increase memory limit

查看:67
本文介绍了增加内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的php脚本可以动态创建PDF,数据来自mysql db表,可以正常工作到30条记录,但超过它说的

My php script creates PDF on fly, the data comes from mysql db table it works fine till 30 records but more than that it says

我是dompdf,来自 http://code.google.com/p/dompdf/

I am dompdf from http://code.google.com/p/dompdf/

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 56214 bytes) in F:\xampp\htdocs\wiseworker\dompdf\lib\class.pdf.php on line 3043

但是我用过ini_set("memory_limit","96550M"); 并在php.ini中设置

however I have used ini_set("memory_limit","96550M"); and also set in php.ini

; Maximum amount of memory a script may consume (5120MB)
; http://php.net/memory-limit
memory_limit = 96550M

我还增加了查询执行时间

I also increase query execution time

if( !ini_get('safe_mode') ){
        set_time_limit(0);
    }

但是它仅限制在45字节到65字节之间,如果mysql表包含数百条记录会发生什么?

but it just limited around 45bytes to 65bytes and what will happen if mysql table contain hundreds of records?

推荐答案

好的,我只需要在dompdf类中设置memory_limit = 94G,现在它正在创建大型pdf,但是几分钟后浏览器会说连接已重置-虽然页面加载时重置了与服务器的连接.等等."尽管我将执行时间增加到3600秒////ini_set('max_execution_time',3600)

Ok thanks to all I just need to set memory_limit = 94G in dompdf class and now it is creating large pdf but after some minutes browser says "The connection was reset - The connection to the server was reset while the page was loading. etc...." although I increase the execution time up to 3600 sec //ini_set('max_execution_time', 3600)

这篇关于增加内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆