Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with PHP 5.2.17 #139

Closed
artcs opened this issue Dec 19, 2015 · 5 comments
Closed

Compatibility with PHP 5.2.17 #139

artcs opened this issue Dec 19, 2015 · 5 comments

Comments

@artcs
Copy link

artcs commented Dec 19, 2015

On a Server running PHP 5.2.17 Smarty 3.1.29-dev/11 is no longer working.
On every page call two warnings are dropped:

[19-Dec-2015 12:35:03] PHP Warning:  Cannot modify header information - headers already sent in Unknown on line 0
[19-Dec-2015 12:35:03] PHP Warning:  Cannot modify header information - headers already sent in Unknown on line 0

Additionaly I see the following errors/warnings occasionaly:

[19-Dec-2015 12:28:59] PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /smartylib/sysplugins/smarty_internal_compile_private_foreachsection.php on line 116
[19-Dec-2015 12:24:29] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /smartylib/sysplugins/smarty_internal_method_configload.php on line 165

Everything works without errors/warnings up to Smarty 3.1.27.
It works flawlessly also with Smarty 3.1.29-dev/11 on PHP 5.5.
All I found about PHP compatibility in the Smarty docs is that it needs PHP 5. Did this change with the current version?

@uwetews
Copy link
Contributor

uwetews commented Dec 19, 2015

PHP 5,2 incompatibilities have been removed in the master branch version.
'Cannot modify header information' could be caused by characters before the '<?php' of php files. I could not find this in the Smarty distribution.

@uwetews uwetews closed this as completed Dec 19, 2015
@Croydon
Copy link

Croydon commented Dec 19, 2015

I seriously hope that this server is not reachable over the internet. PHP 5.2 had its end of life on 6 Jan 2011.

@artcs
Copy link
Author

artcs commented Dec 20, 2015

Thank you for fixing the errors. The Cannot modify header information warning must be related to Smarty and was introduced on Oct 18. Up to commit ca9ccfc the warning dosen't show up, but it happens from commit c99fe14. But nevermind. I'm fine with using 3.1.27 until they update their obsolete PHP installation.

@uwetews
Copy link
Contributor

uwetews commented Dec 20, 2015

Have you tested the updated master branch version?

I could not install PHP 5.2 here, so I cant test

@artcs
Copy link
Author

artcs commented Dec 20, 2015

Further investigation shows: the warning comes from an error in old PHP versions (<=5.4.5) regarding output buffering using ob_start('ob_gzhandler'), which I use in the project. Explicitly flushing the buffer with masking the warnings (@ob_end_flush()) fixes the issue. So it's not Smarty's fault, it was just accidently triggered by some changes in the Smarty lib. This explains why it dosen't fail in PHP 5.5+. I apologize for the inconvenience...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants