大网数据广告活动
网站运营与故障问答

Installing mPDF PHP library for website without root access

· 52CE 我爱测

I would like to install mPDF for use on my website. However, I don't own my own server, and am using shared web hosting. I can log in using FTP, but AFAIK I do not have access to a terminal nor root access on the server. Is there…

问题原文

原帖链接 · posfan12 · CC BY-SA 4.0

I would like to install mPDF for use on my website. However, I don't own my own server, and am using shared web hosting. I can log in using FTP, but AFAIK I do not have access to a terminal nor root access on the server.

Is there some other way to install this thing? Maybe by just copying files over using FTP? I don't know a whole lot about Unix or Linux.

Here's what my FTP folder tree looks like:

There's more stuff at the bottom I didn't capture.

已采纳解答

原帖链接 · richhallstoke · CC BY-SA 4.0

To install mPDF root privileges are not required, FTP access will be sufficient and it should work fine on shared hosting environments. Simply unzip the files and subfolders and then copy them into a folder called mpdf, then you can use the mPDF library by using a line like require_once('mpdf/mpdf.php'); to load the functionality.

To clarify, mPDF is a number of PHP classes in .php files rather than a compiled binary module which must be loaded into the core PHP service/daemon. To PHP or webserver configuation changes will be required unless a prerequisite PHP module is not loaded or misconfigured.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。