dompdf working for a year - now not with AWS.

462 views
Skip to first unread message

artworthy

unread,
Jan 28, 2012, 7:16:58 PM1/28/12
to dompdf
Dompdf was working fine for a year with php 5.3 on an Amazon server
instance (ec2). But when my server administrator switched the ec2 to
another server, now the script won't run completely. I've tested and
determined it dies at: $dompdf = new DOMPDF(); // Create new instance
of dompdf

I have the latest version of dompdf.

Is there something in php.ini that needs a setting change?

Suggestions welcomed,

Thanks,
Allen

psychoactive

unread,
Jan 29, 2012, 5:59:29 PM1/29/12
to dom...@googlegroups.com
What is the error message?



--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To post to this group, send email to dom...@googlegroups.com.
To unsubscribe from this group, send email to dompdf+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dompdf?hl=en.


Allen Sheppard

unread,
Jan 29, 2012, 8:52:42 PM1/29/12
to dom...@googlegroups.com
Just the server error page 


Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com

psychoactive

unread,
Jan 29, 2012, 9:08:35 PM1/29/12
to dom...@googlegroups.com
I mean in the error log, there is nothing? There should be some kind of error in the error log... I suspect one of the required extensions is not loaded or something. I would first of all compare the working and non-working php.ini in the extensions section and make sure all of the same extensions are loaded. Can you give that a try?

Allen Sheppard

unread,
Jan 29, 2012, 10:10:58 PM1/29/12
to dom...@googlegroups.com
I don't have access to the php log (as I did before the change over to the new ec2) on the server. I vaguely remember a log in dompdf -- but could be wrong. If so, what is the path to it?

Also, the old php.ini was deleted by my aws administrator.

-allen


Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com


psychoactive

unread,
Jan 29, 2012, 10:22:20 PM1/29/12
to dom...@googlegroups.com

I thought the error log would be automatically created in the directory where the offending script was located. As for a dompdf log I do not know. Can you set the display errors on such is described here: http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html

Allen Sheppard

unread,
Jan 30, 2012, 9:57:20 AM1/30/12
to dom...@googlegroups.com
That code snippet for error logging is a god-sent. Thanks!

This is the message when I run my html_transPage.php file:
Fatal error: Class 'DOMDocument' not found in /var/www/mobiarts.net/myGallerist/dompdf/include/dompdf.cls.php on line 196

And line 196 is:
$this->_xml = new DOMDocument();


Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com


psychoactive

unread,
Jan 30, 2012, 10:48:29 AM1/30/12
to dom...@googlegroups.com
Now we're getting somewhere! It seems to be a problem with DOM... is your ec2 running debian? Can you, or someone, install php-xml?  For instance apt-get install php-xml or yum-get install php-xml then reboot?

Allen Sheppard

unread,
Jan 30, 2012, 11:11:10 AM1/30/12
to dom...@googlegroups.com
My administrator is in Indian (an oDesk.com guy). I'll forward your info now. I'm not sure if the new instance is running debian -- couldn't get that info anywhere from the console. He did say it was "micro instance with EBS root device" in his emails to me, that's all. In any case... is installing php-xml what's needed? -- seems to be.

Let you know how I make out once he does.

Thanks for your GREAT help.

Allen

Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com


psychoactive

unread,
Jan 30, 2012, 11:37:41 AM1/30/12
to dom...@googlegroups.com
I believe so. I hope that works out, if it doesn't be sure to post back and we'll get it working.

Fabien Ménager

unread,
Jan 30, 2012, 12:04:26 PM1/30/12
to dom...@googlegroups.com
Hello, this is not php-xml, but PHP DOM that need to be installed. It is usually installed by default since PHP 5. 
If you want to check the dompdf installation, go to dompdf/www/setup.php from your browser if you use dompdf 0.6 beta.

Allen Sheppard

unread,
Jan 30, 2012, 1:10:49 PM1/30/12
to dom...@googlegroups.com
He installed as I instructed and Dompdf is working now.

Thanks!
Allen



Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com


On Mon, Jan 30, 2012 at 12:04 PM, Fabien Ménager <fabien....@gmail.com> wrote:
Hello, this is not php-xml, but PHP DOM that need to be installed. It is usually installed by default since PHP 5. 
If you want to check the dompdf installation, go to dompdf/www/setup.php from your browser if you use dompdf 0.6 beta.

--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dompdf/-/NRHG-F4-tH8J.

psychoactive

unread,
Jan 30, 2012, 1:13:28 PM1/30/12
to dom...@googlegroups.com
Hooray!

Allen Sheppard

unread,
Jan 30, 2012, 10:43:13 PM1/30/12
to dom...@googlegroups.com
Hey,
Quick css question: How do you get the first pdf page to have a top margin of 10px? I've tried everything and only able to get the successive pages down to 10px... the first always stays at about 40. Tried modifying html.css in dom as well as my css in html_header.php -- with no luck.

Thanks
Allen


Allen Sheppard, Director
Allen Sheppard Gallery (by appointment)
2424 E. York St. Loft 219
Philadelphia, PA 19125
212 989-9919 AllenSheppardGallery.com


psychoactive

unread,
Jan 31, 2012, 3:41:07 AM1/31/12
to dom...@googlegroups.com

Hmm. It should be the same on each page, are you sure there are no p tags up there or something pushing it down?

BrianS

unread,
Feb 7, 2012, 10:34:57 PM2/7/12
to dom...@googlegroups.com
On Monday, January 30, 2012 10:43:13 PM UTC-5, artworthy wrote:
Hey,
Quick css question: How do you get the first pdf page to have a top margin of 10px? I've tried everything and only able to get the successive pages down to 10px... the first always stays at about 40. Tried modifying html.css in dom as well as my css in html_header.php -- with no luck.

This is something you should be able to control with your CSS. Setting the margins on @page and body should affect all pages in the document. It could be some empty elements at the top of your document. Or an element at the top of your document styled with a large margin. I have also seen some instances where the document structure causes some weirdness in rendering. It would help to see a sample document that exhibits the problem, if you are able to share something.

Miguel Rivera

unread,
Mar 6, 2015, 6:18:10 PM3/6/15
to dom...@googlegroups.com, psycho...@gmail.com
Hello,

I'm having a similar issue. My scripts work fine on diffrerent servers, but not on AWS EC2.

The PDF gets generated on the fly:


But when I try to save, I get an error. (On Chrome and IE, works on Firefox)

According to my config, everything looks OK:


Please help! it's driving me crazy!

BrianS

unread,
Mar 6, 2015, 11:01:01 PM3/6/15
to dom...@googlegroups.com
What kind of error do you receive? Is it on the client or server? Have you tried saving the PDF to the server then redirecting the user to the file?
Reply all
Reply to author
Forward
0 new messages