Bug #21383
closedcObject FILE dos not Work with PHP 5.3
Added by Olaf Clemens about 15 years ago. Updated over 14 years ago.
0%
Description
page = PAGE
page.10 = FILE
page.10.file = fileadmin/datei.html
did not work in TYPO3 4.3 beta2 with PHP 5.3.
Works fine with PHP 5.2.x
(issue imported from #M12370)
Files
patch_20091125_1.diff (694 Bytes) patch_20091125_1.diff | Administrator Admin, 2009-11-26 10:51 |
Updated by Oliver Hader about 15 years ago
Hi Olaf,
do your PHP/Apache logfiles tell something about it?
Updated by Olaf Clemens about 15 years ago
Hi Oliver,
there is no entry in the error log (error reporting E_STRICT).
I test ist again with TYPO3 4.3 dev revision 6354.
php -v
PHP 5.3.0 (cgi-fcgi) (built: Sep 10 2009 12:32:08)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
no output in Frontend.
With
php -v
PHP 5.2.11 (cgi) (built: Sep 22 2009 09:29:23)
Copyright (c) 1997-2009 The PHP Group
The file is shown in the frontend.
Updated by Rupert Germann about 15 years ago
hi
just tested it with PHP 5.3 on win (xammp) -> your snippet works as expected
Updated by Olaf Clemens about 15 years ago
Hi,
confusing,
on windows xampp works fine - that’s right on a Linux system not.
Are there some other guys that test it on a Linux system?
So I am sorry, it can closed and it is only my FILE failure ;)
Updated by Erik Sokoll almost 15 years ago
We have the same problem.
For example the following (root) TS-Template...
--------------------------------------------------------
page = PAGE
page.typeNum = 0
page.5 = HTML
page.5.value = blafasel
page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/templates/erik_test.html
workOnSubpart = DOCUMENT_BODY
subparts.CONTENT < styles.content.get
}
--------------------------------------------------------
...returns only 'blafasel' inside the <body> tag
If I do the same within 'file = GIFBUILDER' it does not work as well.
Our PHP configuration looks like this.
http://62.146.189.230/_phpinfo.php
Updated by Mirko Kaufmann almost 15 years ago
I have tested this issue in TYPO3 4.3.0-RC2 in combination with PHP 5.3.0. I have the same error, it only works with PHP 5.2.x. The apache error log throws no error. Someone has an idea?
Updated by Julian Hofmann almost 15 years ago
Hi.
I tested this snippet and can confirm this behaviour for symlinked installations.
Testing enviroment:
- LAMP, PHP 5.3.1 (cgi-fcgi)
- TYPO3 4.3.RC2 (also *beta3, *RC1) based on tar.gz-package
Imagine a file structure like:
/www/htdocs/
/www/htdocs/typo3_src -> ../typo3_src-4.3.0RC2
/www/typo3_src-4.3.0RC2
Calling is_file() in t3lib/class.t3lib_tstemplate.php, line 1203 fails, so getFileName() returns nothing. Accordingly fileContent() in same class returns nothing, because $incFile is empty.
Why does is_file() fail?
As parameter of this function call, TYPO3 gives "fileadmin/datei.html" to PHP. PHP uses as working directory the symlinked folder (/www/typo3_src-4.3.0RC2/) instead of our webroot (/www/htdocs/). So, PHP searches the template as /www/typo3_src-4.3.0RC2/fileadmin/datei.html which does not exist.
So, it is a bug in PHP. Because this wrong behaviour of PHP returns from time to time(2007-09-07, PHP-Bug 42587; 2008-12-08, 46814; 2009-11-12, 50159), we should find a solution for TYPO3.
One possibillity should be setting $this->getFileName_backPath to PATH_site before calling is_file() in case $this->getFileName_backPath is empty. See patch
Updated by Mirko Kaufmann almost 15 years ago
Right, i got a symlink installation. In the version 4.3.0-rc2 the patch is already implemented but unfortunately no success. (PHP 5.3.0)
I will try it with PHP 5.3.1 in the next hours.
Updated by Mirko Kaufmann almost 15 years ago
Same error with PHP 5.3.1 Without symlinks it works well.
Updated by Benni Mack almost 15 years ago
Hey,
I cannot reproduce this issue on my system (Mac, apache2_mod_php, PHP 5.3.0) with the latest trunk version. Can you try again?
All the best,
Benni.