不过测试还是上面那个错误,我按照PDFlib的php的readme来: Using the PDFlib module: - If you decide to load PDFlib each time PHP starts, insert one line in php.ini: extension=libpdf_php.dll (on Windows) or extension=libpdf_php.so (on Unix) and restart apache, so that the changes are recognized. You may check <?phpinfo()?> whether the installation worked. If you don't find a PDF section please check your logfiles for the reason. - Without the "extension = ..." line in php.ini you must include the following line in your PHP scripts: dl("libpdf_php.dll"); (on Windows) or dl("libpdf_php.so"); (on Unix) In this case your php.ini must contain these settings: - php.ini must include the line "safe_mode=Off". - php.ini must include the line "enable_dl=On". -------- 我所做的就是 php.ini: extension=libpdf_php.dll 然后重启Apache,但是,上面的页面错误依旧。还是Fatal error: Call to undefined function: pdf_new() =============== 没有办法我只有测试下面的方法,在pHP脚本前面添加 dl("libpdf_php.dll"); 这回才可以了。注意,我遵循了 - php.ini must include the line "safe_mode=Off". - php.ini must include the line "enable_dl=On". 才可以的。 问题似乎解决了
前面的;都去掉了,不过查看phpinfo的时候,pdf支持是个×~, 不知道为什么
我这里有一份PDFLib-6.0.0p1 for Windows版本,需要的话给你发一份,下载地址已经忘记了
Using the PDFlib module: - If you decide to load PDFlib each time PHP starts, insert one line in
php.ini:
extension=libpdf_php.dll (on Windows)
or
extension=libpdf_php.so (on Unix) and restart apache, so that the changes are recognized.
You may check <?phpinfo()?> whether the installation worked. If you
don't find a PDF section please check your logfiles for the reason. - Without the "extension = ..." line in php.ini you must include the
following line in your PHP scripts:
dl("libpdf_php.dll"); (on Windows)
or
dl("libpdf_php.so"); (on Unix) In this case your php.ini must contain these settings:
- php.ini must include the line "safe_mode=Off".
- php.ini must include the line "enable_dl=On".
--------
我所做的就是
php.ini:
extension=libpdf_php.dll
然后重启Apache,但是,上面的页面错误依旧。还是Fatal error: Call to undefined function: pdf_new()
===============
没有办法我只有测试下面的方法,在pHP脚本前面添加
dl("libpdf_php.dll");
这回才可以了。注意,我遵循了
- php.ini must include the line "safe_mode=Off".
- php.ini must include the line "enable_dl=On".
才可以的。
问题似乎解决了
建一个phpinfo.php文件,输入以下内容:
<?php phpinfo();?>保存到你的服务器的web目录中去,重启Apache之后。然后在浏览器中浏览http://localhost/phpinfo.php
如果PDF支持是加载了的,就会有PDF支持的信息.
我的这里是这样的(是表格的形式):
pdf
PDF Support enabled
PDFlib GmbH Binary-Version 6.0.0p1
Revision $Revision: 1.55.2.2 $ --------------------------
以前出错的时候都没有发现这个的.
至于是怎么成功的,我下面有叙述:
把libpdf_php.dll(我的PHP是4.34版本的),按照PDFlib的官方说明,把这个libpdf_php.dll拷贝到PHP目录的extensions目录中去,然后在php.ini中添加
extension=libpdf_php.dll
保存,然后重启Apache.
在浏览器中检查http://localhost/phpinfo.php
就可以看到pDF的支持了.
--------------------------
我的错误产生的原因:
我使用的是微米天空的phpMyAdmin5.5,不过安装的时候,我没有按照微米说的,一定要安装到D盘,我改到了C盘,结果当然是不能够用的,只是我把配置(Apache配置和PHP配置)中所有指向D盘任何一个目录,都修改为指向C盘对应目录.结果就能够用了.不过直到今天,查看我的http://localhost/phpinfo.php (内容见上面)
仔细看了一遍之后,我才发现显示的是:
Configuration File (php.ini) Path c:\usr\local\php\php.ini
而不是我以前每次修改PHP.ini,我用的是usr目录下面,微米提供的快捷方式,它指向我的D:\windows\php.ini
原来我以前所有针对php的修改其实都没有起作用.真正控制我的php的还是 c:\usr\local\php\php.ini ,它根本就没有修改过.
我发现了这个之后,上面的问题就迎刃而解了.浪费了大家和我自己的时间,真是不好意思.不过,解决了问题,我还是很高兴的.
这里谢谢所有回复的大侠,尤其谢谢 fzjw(冰冰(icy mote)) ,谢谢他给我的pdflib.
虽然他的解决方案,不同于官方说明文档中的.
他的解决方案我没有测试.