简体   繁体   English

如何在WAMP服务器上安装pdflib

[英]How to install pdflib on WAMP Server

I want to install pdflib on my wampserver2. 我想在我的wampserver2上安装pdflib。

I have downloaded pdflib and I've set the following line: 我已经下载了pdflib,并设置了以下行:

extension=php_pdflib.dll

in my php.ini file, but I'm still getting a Call to undefined function pdf_new() error. 在我的php.ini文件中,但我仍然在Call to undefined function pdf_new()错误。

You must copy the libpdf_php.dll to the extension directory of your php installation (check for extension_dir in your phpinfo() output). 您必须将libpdf_php.dll复制到php安装的扩展目录(检查phpinfo()输出中的extension_dir )。

Also take care to use the version of PDFlib that matches your php version and compiler (multiple versions are included in the download you mentioned). 还要注意使用与您的php版本和编译器匹配的PDFlib版本(您提到的下载中包含多个版本)。

Then add extension=libpdf_php.dll to the php.ini (you can also find it's location listed in the phpinfo() output, just look for php.ini ). 然后将extension=libpdf_php.dll添加到php.ini (您也可以在phpinfo()输出中找到它的位置,只需查找php.ini )。

Restart your webserver and check if you have a "PDF" entry in your phpinfo() and if so, congratulations! 重新启动您的网络服务器并检查您的phpinfo()是否有“PDF”条目,如果是,请恭喜!

If you want more detailed information about PDFlib and it's use in php , be sure to check out the online php howto (a pdf link, of course) and also consult the documentation included in your download package. 如果您想了解有关PDFlib及其在php中使用的更多详细信息,请务必查看在线php howto (当然是pdf链接),并查阅下载包中包含的文档。

Here are what you should do in order to install phppdf library: 以下是安装phppdf库时应该做的事情:

1 . 1。 download : download the package which matches your php version from here (check the php version using phpinfo() command). 下载 :从这里下载与你的php版本匹配的软件包(使用phpinfo()命令查看php版本)。

The package shall contain the following files, 包裹应包含以下文件,

php_pdflib.dll  //php extension
php_pdflib.pdb  //don't know what it does!
pdflib.dll      //actual pdf library

2 . 2。 copy : copy php_pdflib.dll into the extensions directory (again find the extension directory using phpinfo() command "extension_dir" ). copy :将php_pdflib.dll复制到extensions目录中(再次使用phpinfo()命令“extension_dir”查找扩展目录)。 also copy php_pdflib.pdb and pdflib.dll into the main php directory ( right next to the php.exe ) 还将php_pdflib.pdbpdflib.dll复制到主php目录( php.exe旁边

3 . 3。 config : add the extension to php.ini. config :将扩展名添加到php.ini。 just remember wamp uses another version of php.ini at apache/bin/php.ini , So make sure you're making changes on the right file. 只记得wamp在apache / bin / php.ini上使用另一个版本的php.ini,所以请确保你在正确的文件上进行更改。 (again find the php.ini's path using phpinfo() command, Loaded Configuration File ). (再次使用phpinfo()命令, 加载配置文件找到php.ini的路径)。 Add the following line: 添加以下行:

extension=php_pdflib.dll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM