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

PHP 5.2 -> 5.3 anomalies. Redirect due to Location return in Header after Action Post (Trac #2163) #2163

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 16 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/2163 on 40341441-11-20 by trac user tomv, assigned to unknown.

Elgg version: 1.7

After installing a new ubuntu dev server with 5.3, certain AJAX -> actions did not work anymore.

Digging the code for 2 hours caused grey hairs but solved nothing. Reverting the standard php.ini from 5.3 to our 5.2 did solve the issue. We still need to Diff what exactly caused the problem... Somehow php 5.3 standard returns a Location header that redirects the browser instead of showing the AJAX output... no clue why...

@elgg-gitbot
Copy link
Author

Attachment added by trac user tomv on 40341443-04-25: php.ini

@elgg-gitbot
Copy link
Author

Attachment added by trac user tomv on 40341443-12-24: php_not_working_AJAX_publications.ini

@elgg-gitbot
Copy link
Author

brettp wrote on 40457097-05-08

tomv - Is there any update on this?
everyone - Has anyone else had problems on 5.3 with stock php.ini?

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40458099-02-16

brettp, we running fine since on 5.3 with the 5.2 php.ini and did not look back. We have not figured out what php setting(s) causes the the troubles. If you think its usefull we can try and iterate until we found it. However, for sure no expert on Apache/PHP, so cant add much knowledge to the process...

@elgg-gitbot
Copy link
Author

Attachment added by trac user tomv on 40477283-01-29: php_ini_diff.txt

@elgg-gitbot
Copy link
Author

trac user bman wrote on 40488077-10-01

tomv - I have tested with your php_not_working_AJAX_publications.ini with Ubuntu Lucid and debian lenny with php5.3. Used with publications, riverdash, likes, embed, and any other AJAX using plugins that I had and have found no issues at all. Seems like your problems is unrelated to elgg, php5.3 or ajax plugins. Was there a particular plugin or feature that did not work? More information is needed to verify this bug as I don't seem to find any AJAX issues specific to PHP5.3 and elgg.

@elgg-gitbot
Copy link
Author

trac user bman wrote on 40488262-11-17

EXTRA INFO: The only way this could possibly happen on the publications plugin was if you have the embed plugin disabled. Then it redirects to a non working page.

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40491155-11-26

bman: The problems came because of php returning a wrong header. We do not have embed or the publications plugin you mention enabled.

@elgg-gitbot
Copy link
Author

trac user bman wrote on 40491483-04-23

tomv I used your php.ini that didnt work for you, in fact it is still running on my dev machine. I am running I could not find this issue at all. Can you give me more information so that I can reproduce the problem? I just guessed at trying to find ways to reproduce the issue with no luck.

Heres what I tested against:
Linux doors 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686 GNU/Linux
PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (cli) (built: May 13 2010 20:01:00)
Server version: Apache/2.2.14 (Ubuntu)
Again I used your php_not_working_AJAX_publications.ini as my php.ini

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40491545-10-19

bman: ok, seems I have to do some more work to nail it down... Do you use php 5.3.2 ?

@elgg-gitbot
Copy link
Author

trac user bman wrote on 40491658-12-05

PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch
I posted all my versions in my last post.

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40492506-09-24

bman; ok, sorry, your post with details crossed mine somehow. I reverted back to the original php 5.3.2 php.ini to see if I could replicate the issues.... well, I can... but now only in a plugin we created ourself...

So, we will have to solve it ourselves I suppose. No idea where to start :(((

** For now I resolve this ticket as invalid... unless someone else replicates the issues...

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40494042-10-22

Ok, for anyone who care to know, we found the offending PHP setting

default for php 5.3.2 is:

output_buffering = 4096

But that gives action post errors at some specific cases in Elgg... it should be:

output_buffering = Off ;

@elgg-gitbot
Copy link
Author

trac user bman wrote on 40494107-12-18

Thats likely a issue with your plugin and theme, and not elgg. As I said I tested with your "exact" bad settings file and many elgg ajax plugins with 0 failures. ouput_buffering is going to affect your page load times, so be aware and be sure to benchmark it to determine the tradeoffs.

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40494147-06-23

Well, for now we keep output_buffering on 'off' as in php 5.1 was the case. I dont see any reason to leave it on the ubuntu 5.3.2 default of 4096

@elgg-gitbot
Copy link
Author

trac user tomv wrote on 40907516-08-01

To notify people having the same issue: in some cases the AJAX calls can be sensitive to the block size. Also depends on browsers it seems.

after echo, put flush() if you experience these problems:

''echo elgg_view (....);
flush();
''
solved it for us.

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

No branches or pull requests

1 participant