ID: 19741
Updated by: sniper@php.net
Reported By: scott@meikohou.com
-Status: Open
+Status: Feedback
Bug Type: Apache2 related
Operating System: linux 2.4.18
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-10-03 18:39:34] scott@meikohou.com
on further examination it appears only
pdf_open_file($pdf, "somefile.pdf");
does not work and must be substituted with
pdf_open_file($pdf, "$documentroot/somefile.pdf");
(or the smart example)
i took the liberty of checking with pdf.c and it doesnt appear to be
any different.
------------------------------------------------------------------------
[2002-10-03 18:26:38] pkmail1@genion.de
A smarter variant of the workaround is to use
file_exists(realpath('somefile.pdf'));
which works quite fine on Apache 2.0.40
Philipp
------------------------------------------------------------------------
[2002-10-03 14:48:06] scott@meikohou.com
In old apache
1.3.26/php.4.0.6
if (file_exists("somefile.pdf")) unlink("somefile.pdf");
pdf_open_file($pdf, "somefile.pdf");
would check the current directory.
ie .. it will do these actions whereever documentroot happens to be.
now it does not do this anymore in Apache/2.0.42 (Unix) mod_ssl/2.0.42
OpenSSL/0.9.6b PHP/4.2.3
in apache 2.0.42
getcwd() returns the current working directory <documentroot>
however if i do chdir (documentroot)
the first command
if (file_exists("somefile.pdf")) unlink("somefile.pdf");
will work
but the 2nd
pdf_open_file($pdf, "somefile.pdf");
will not.
the workaround seems to be to work is to include the whole path
pdf_open_file($pdf, "$documentroot/somefile.pdf");
which appears to work .. is this a bug or a feature?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19741&edit=1