0

Possible Duplicate:
Allowed memory size of X bytes exhausted

I'm hitting a very tricky issue.

  1. As per phpInfo, the memory limit set for this script is 256M. However, domPDF gets only 64M

  2. When I run the PDF creation action from the frontend, it works like a charm. When a cron calls a sfTask to do it, I get this:

[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

And for the record, its printing one simple page whose PDF size is < 5K

Can someone help?

Community
  • 1
  • 1
Prasad
  • 1,822
  • 3
  • 23
  • 40
  • I am using DOMPDF 0.6.0 beta 3 – Prasad Sep 28 '12 at 05:46
  • I guess the settings for PHP-CLI are different from PHP-CGI/mod_php. You could try to find out using the command `php -i | grep memory_limit` (put it in a shell-script and let the script run by cron if you don't have shell access). – vstm Sep 28 '12 at 05:56
  • Ok, I will try that. Another error I get is: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 83 bytes) in /home3/myspace/public_html/prasad/myapp/lib/vendor/dompdf/include/style.cls.php on line 720 /bin/sh: line 1: 6511 Segmentation fault /ramdisk/bin/php5 /home3/myspace/public_html/prasad/myapp/symfony job:cron --job-type="job" What does **/bin/sh: line 1: 6511 Segmentation fault** mean? – Prasad Sep 28 '12 at 06:01
  • the output is 64M. Is that not sufficient? How can I raise that limit? – Prasad Sep 28 '12 at 06:08
  • 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](http://en.wikipedia.org/wiki/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. – vstm Sep 28 '12 at 06:14
  • Are you using more tables?. If yes, Try to reduce the tables and nested tables. Usage of more tables may causes memory exhausted error. – Hearaman Sep 28 '12 at 06:19
  • No **Hearaman**, there is just 1 table. **Vstm**, you have no clue how grateful I am to you. Pl post both the responses as a answer. Calling with the mem-limit parameter executed the script. Thanks a ton! – Prasad Sep 28 '12 at 06:24

1 Answers1

0

To make from vstms comment an awnser because Prasad solved his problem:

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.

Peter
  • 27,590
  • 8
  • 64
  • 84