Integrate dompdf on Webserver

891 views
Skip to first unread message

Anushaath .P

unread,
Mar 27, 2017, 9:40:18 AM3/27/17
to dompdf
Hi,

First of all, this is a great feature to use and Kudos to the team for doing this open-sourced. 

In my case, I've downloaded dompdf, used composer to update/install all other requirements on the localhost. I was very happy when all of it worked out.

Now, I'm left with the small matter of uploading this on webserver, so that by the click of a button, I can download pdf. 
I haven't found any resources to help me with the uploading process.
My website is hosted on GoDaddy and uses cPanel.

The first step will be to upload the dompdf onto the server. What should be the steps after this? I can't use composer to install the other requirements?

Thanks.

BrianS

unread,
Mar 27, 2017, 9:52:59 AM3/27/17
to dompdf
I haven't used a cPanel host so I can't say if there's a method you can use to make installation on your host easier. You should be able to just upload dompdf to your server, with one caveat: you should clean out out font directory and font cache directory. If you haven't customized these settings then they both point to dompdf/lib/fonts. You're less likely to encounter font issues if you do this.

The quickest way to do this is to remove the directory and replace it with a fresh copy. But if you want to manually clean it out you can do so by removing any installed fonts and related files (TTF, UFM, PHP) and the dompdf_font_family_cache.php file (not the .dist file).

Anushaath .P

unread,
Mar 28, 2017, 6:14:10 AM3/28/17
to dompdf
So, I've to remove installed fonts and the cache file, and then upload everything to the server? I was wondering what I should do about the other requirements as well. Like the php-svg-lib, GD, MBString extension?

Anushaath .P

unread,
Mar 28, 2017, 8:34:28 AM3/28/17
to dompdf
If I install Laravel, I should be able to use dompdf without any changes right?

BrianS

unread,
Mar 30, 2017, 9:43:39 AM3/30/17
to dompdf
php-svg-lib is only necessary if you need to render SVG document. You do need GD and MBString. There is a requirements document on the wiki that may help. If you find anything missing from there please let us know.

BrianS

unread,
Mar 30, 2017, 9:44:45 AM3/30/17
to dompdf
This is mostly true, yes. I believe the one thing you have to ensure is that the storage/fonts directory exists and is read/write.

John Bell

unread,
Apr 6, 2017, 2:06:01 PM4/6/17
to dom...@googlegroups.com

Things like php-svg-lib, GD, MBString extension are controlled by the php build that is used on the server. Are you the server admin? or do you just have an account on a cpanel server? If your app needs these then the server admin will need to recompile Apache/PHP in WHM


John

--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dompdf+un...@googlegroups.com.
To post to this group, send email to dom...@googlegroups.com.
Visit this group at https://groups.google.com/group/dompdf.
For more options, visit https://groups.google.com/d/optout.

Anushaath .P

unread,
Apr 7, 2017, 2:05:17 AM4/7/17
to dompdf
I'm the server admin.

I've found a workaround for this.
On my localhost, I installed php-svg-lib and others using Composer. After all this is installed, I put them in a zip file and unzipped them on the webserver. Now I have all the required files (GD, MBString, php-svg-lib, etc) on the server. 
Dompdf is working great now.

Now I want to know if I can change the name of the PDF file, and I want to store it in the server instead of downloading it. 
Can I store it on the server?

BrianS

unread,
Apr 11, 2017, 6:22:37 PM4/11/17
to dompdf
Reply all
Reply to author
Forward
0 new messages