|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25401 pdflib does not generate pdf
Submitted: 2003-09-06 09:19 UTC Modified: 2003-09-09 09:38 UTC
From: sj at ewetel dot de Assigned:
Status: Not a bug Package: PDF related
PHP Version: 4.3.3 OS: Solaris 2.8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sj at ewetel dot de
New email:
PHP Version: OS:


 [2003-09-06 09:19 UTC] sj at ewetel dot de
Since Upgrading to 4.3.3 the supplied test script does not generate any output.

A telnet session gives only "0" back as body, last known working version is php4-STABLE-200303261230.
Tried with pdflib 4.0.3 (.so) and 5.0.1 (.a) same error with both, nothing to see in the logs. 

Reproduce code:
$p = PDF_new();
PDF_open_file($p, "");
PDF_set_info($p, "Creator", "hello.php");
PDF_set_info($p, "Author", "Rainer Schaaf");
PDF_set_info($p, "Title", "Hello world (PHP)");
PDF_begin_page($p, 595, 842);
# Change "host" encoding to "winansi" or whatever you need!
$font = PDF_findfont($p, "Helvetica-Bold", "host", 0);
PDF_setfont($p, $font, 18.0);
PDF_set_text_pos($p, 50, 700);
PDF_show($p, "Hello world!");
PDF_continue_text($p, "(says PHP)");
$buf = PDF_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=hello.pdf");
print $buf;

Expected result:
The generated PDF should show up in the browser.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-06 10:05 UTC]
Works fine for me with PHP 4.3.3 (and latest CVS too).
What configure line did you use?
What if you run the script on command line (using CLI)?
Are you sure you're not getting some error there?
etc. etc.

 [2003-09-06 13:30 UTC] sj at ewetel dot de
configure is:

./configure  --prefix=/webserver/libs/php-4.3.3 --enable-force-cgi-redirect --with-openssl=/webserver/libs/openssl-0.9.7b --with-zlib --with-zlib-dir=/webserver/libs/zlib-1.1.4 --enable-bcmath --enable-calendar --with-jpeg-dir=/webserver/gfx-libs --with-tiff-dir=/webserver/gfx-libs --enable-ftp
--with-gd --with-png-dir=/webserver/gfx-libs --with-jpeg-dir=/webserver/gfx-libs --with-freetype-dir=/webserver/gfx-libs --enable-gd-native-ttf --with-mysql=/webserver/mysql --with-pdflib=/webserver/libs/pdflib-4.0.3-SunOS/bind/c --with-tiff-dir=/webserver/gfx-libs --enable-wddx --enable-memory-limit --with-ldap=/webserver/libs/openldap-2.1.22 --enable-sysvsem --enable-sysvshm --with-apxs=/webserver/server/apache-1.3.28/bin/apxs --with-config-file-path=/webserver/apache/conf/php --with-curl=/webserver/libs/curl-7.10.7

it seems to work with the cli interpreter.
(in the php version i used before pdflib works with exactly the same configure, lib versions and apache)

here's the telnet output:
HTTP/1.1 200 OK
Date: Sat, 06 Sep 2003 17:16:24 GMT
Server: Apache/1.3.28 (Unix) PHP/4.3.3 mod_ssl/2.8.15 OpenSSL/0.9.7b
X-Powered-By: PHP/4.3.3
Transfer-Encoding: chunked
Content-Type: text/html
 [2003-09-06 19:08 UTC]
Try this:

# rm config.cache
# ./configure \
--with-pdflib=/webserver/libs/pdflib-4.0.3-SunOS/bind/c \
--with-apxs=/webserver/server/apache-1.3.28/bin/apxs \
--disable-all --disable-cli
# make clean && make
# cp .libs/ /webserver/server/apache-1.3.28/libexec

And restart apache, try the script again.

 [2003-09-07 07:07 UTC] sj at ewetel dot de
doesn't work either, but when i try with telnet now,
i get no body at all, the "0" is gone.
 [2003-09-07 11:08 UTC]
Do 'apachectl stop' and make sure it REALLY stopped
before you start it again. (never use 'apachectl restart' after upgrading PHP)

 [2003-09-07 12:04 UTC] sj at ewetel dot de
I did, really ;).
Now, i even waited 2 minutes after the last proc exited just to go sure.

Maybe the test before i was too fast, because now i get the body with the 0 again.
 [2003-09-07 12:15 UTC]
Do you happen to have any Zend extensions loaded? Such as some debugger/cache? And what's the diff between php.ini-dist (assuming you used that as base) and your php.ini ??

 [2003-09-07 12:26 UTC] sj at ewetel dot de
no extensions.

php.ini is just:
error_reporting = 0
session.save_path = /webserver/httproot/php-session-data
register_globals = On
safe_mode_gid = On
mysql.allow_persistent = Off
mysql.max_persistent = 0

everything is the same as with the php version i used before.
 [2003-09-07 12:29 UTC]
With that php.ini, the script you provided works as fine as it did before. Please provide access to this machine where the bug happens, I have no solaris machine's to test with.

 [2003-09-07 12:39 UTC] sj at ewetel dot de
wow, thats a tough one ;)

it's our productive webhosting cluster, i have to check with several people if it is possible at all.

i will do this tommorow morning.
 [2003-09-07 13:01 UTC]
keep the feedback status until you can give it.

 [2003-09-09 03:21 UTC] sj at ewetel dot de
while setting up a machine for you to test with, i had to find out it works there...

Pretty clueless now, because the old version works on the other machine too, just the 4.3.3 does not, anyhow seems to be no php bug, do you have any more ideas what to check?
 [2003-09-09 09:38 UTC]
No idea. And as it was proved not to be bug in PHP -> bogus.
(try comparing the configs on the machine where it works vs. where it doesn't)

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Aug 15 12:01:25 2020 UTC