2012-09-28 49 views
0

Possible Duplicate:
Allowed memory size of X bytes exhaustedDomPDF>允許的內存耗盡

我遇到了一個非常棘手的問題。

  1. 根據phpInfo,此腳本設置的內存限制爲256M。但是,domPDF只能獲得64M。

  2. 當我從前端運行PDF創建操作時,它就像一個魅力。當一個cron調用sfTask做到這一點,我得到這個:

[28-Sep-2012 10:41:03] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 76 bytes) in /home3/myspace/public_html/prasad/myapp/lib/vendor/dompdf/include/frame_decorator.cls.php on line 30

並記錄在案,其打印PDF,其大小爲5K <

有人能幫助一個簡單的頁面?

+0

我使用DOMPDF 0.6.0 Beta 3的 – Prasad

+0

我猜PHP-CLI的設置是從PHP-CGI/mod_php的不同。您可以嘗試使用命令'php -i |查找grep memory_limit'(把它放在shell腳本中,如果你沒有shell訪問權限,讓腳本運行cron)。 – vstm

+0

好吧,我會嘗試。我得到的另一個錯誤是:致命錯誤:在/home3/myspace/public_html/prasad/myapp/lib/vendor/dompdf/include/style.cls.php在線內允許67108864個字節的內存大小用盡(嘗試分配83個字節) 720 /bin/sh:第1行:6511分段錯誤/ ramdisk/bin/php5/home3/myspace/public_html/prasad/myapp/symfony作業:cron --job-type =「job」**/bin/sh:第1行:6511分段錯誤**是什麼意思? – Prasad

回答

0

從vstms作出評論的awnser因爲普拉薩德解決了他的問題:

No, 64M is not sufficient hence the "Allowed memory"-error. You have to find the php.ini of the CLI and change it there. The alternative is to change the setting via command line - like php -d memory_limit=256M /path/to/your/php-file. A segmentation fault occurs when a program tries to access invalid memory. It's likely a problem with the PHP-interpreter itself. It would be hard to find the reason, even with shell-access.

相關問題