|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26118 fdf-functions do not work
Submitted: 2003-11-04 11:45 UTC Modified: 2003-11-05 07:53 UTC
From: admin at evodot dot de Assigned:
Status: Not a bug Package: FDF related
PHP Version: 4.3.3 OS: debian linux 3.0
Private report: No CVE-ID: None
 [2003-11-04 11:45 UTC] admin at evodot dot de
On a debian linux 3.0 with all-standard packages the phplib
is to be substituted by a self-compiled one incl. fdf-support.

Got the sources of php 4.3.3 and FdfTk v5.0 and compiled
without severe problems (only some develop-packages, which
had to be added).

But of the fdf-functions is actually available, i.e. any
of 'fdf_open( $file )', 'fdf_open_string( "$HTTP_FDF_DATA" )'
or even 'fdf_create()' fails without any further comment.

In the log you can only find the complaints of
'fdf_close()', 'fdf_save()' and so on ...

Btw. I tried both, fdf as shared object and statical linked
into php:

./configure --prefix=/usr/local --with-exec-dir=/usr/local/lib/php
--with-pgsql=no --with-mysql=shared,/usr --with-gd=shared,/usr
--with-tiff-dir=shared,/usr --with-jpeg-dir=shared,/usr
--with-png-dir=shared,/usr --with-xpm-dir=shared,/usr/X11R6 --with-pdflib=no
--with-imap=no --with-ldap=no --with-zlib=yes --with-xml --with-ttf
--with-sablot --with-readline --with-ftp --with-gettext=no --with-mm
--with-freetype-dir=shared,/usr --enable-versioning --enable-yp=no
--enable-bcmath --enable-trans-sid --enable-inline-optimization
--enable-track-vars --enable-magic-quotes --enable-safe-mode
--enable-sockets --enable-sysvsem --enable-sysvshm --enable-shmop
--enable-exif --enable-ftp --enable-memory-limit --enable-wddx
--enable-filepro --enable-dbase --with-config-file-path=/etc/php4/apache
--with-apxs=/usr/bin/apxs --with-fdftk=/usr/local

resp. --with-fdftk=shared,/usr/local

Reproduce code:
$fdf_doc = fdf_create () or error_log ( "test.php: \
fdf_create() failed", 0 );

fdf_save ( $fdf_doc, "/tmp/test.fdf" ) or error_log ( \
"test.php: fdf_save() failed", 0 );

fdf_close ( $fdf_doc );

Expected result:
to have a fdf-file named /tmp/test.fdf ... sort of :-}

Actual result:
[04-Nov-2003 17:10:24] test.php: fdf_create() failed
[04-Nov-2003 17:10:24] PHP Warning:  fdf_save() expects \
parameter 1 to be resource, boolean given in \
/var/apache/htdocs/test.php on line 15
[04-Nov-2003 17:10:24] test.php: fdf_save() failed
[04-Nov-2003 17:10:24] PHP Warning:  fdf_close(): supplied \
argument is not a valid fdf resource in \
/var/apache/htdocs/test.php on line 17


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-04 16:04 UTC]
Try this

fdf_create() or die(fdf_error(fdf_errno()));

That hopefully will return a human readable error from the fdf library telling you when the fdf_create() function failed.
 [2003-11-05 00:33 UTC]
Please read the manual before submitting any bug reports.
There is no bug here.

 [2003-11-05 07:53 UTC] admin at evodot dot de
Thank you, Iliaa, tried:

$fdf_doc = fdf_create () or die ( fdf_error ( fdf_errno () ) );

and got:

"An internal FDF Library error occurred"

Btw., I did read all the manuals, and IMHO it is a bug,
if there isn't any comment/log-output given when those
functions fail ...
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:25 2019 UTC