1
highlander
xlanguage and php 5.2
  • 2007/2/25 10:24

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


Hi All,

I have been racking my brain on this for hours now
and just can't seem to find it, can anyone give me a hand ?

My host has set up a testing site for me as they are going to upgrade from php 5.1.6 to 5.2

A blank screen is being displayed after the upgrade because of an error which is being caused by xlanguage in the buffer. I have found out it is the following line in modules/xlanguage/include/functions.php
$langs =& $GLOBALS["xlanguage_handler"]->getAll(true);

I know it is this line because if i put reutrn $s; on the line before it the functions gets exited and the output to the buffer stops. My site then shows up but obviously with all the langauge tags displayed.

Does anyone know why php 5.2 might have a problem with this part of xlanguage ?
If I add this line to the .htaccess file :
AddType application/x-httpd-php-.php
to force the server into php4 mode everything works as expected.

Dropping Xlanguage is not an option for us and seeing as it will become part of the core this might affect others to.
This error is happing with xlanguage 2.04 and the new xlangauge 3.0 versions. Allthough the xlanguage_ml() functions differs the error is still thrown on the same line ! ($langs =& $GLOBALS["xlanguage_handler"]->getAll(true);)


Can anyone think up a good strategy to find out what is going wrong ?

Kind reagrds,

Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
http://www.AnimalPedigree.com

2
highlander
Re: xlanguage and php 5.2
  • 2007/2/25 13:29

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


Fixed it... *does the happy dance*

Here's what I needed to do to get it working. (both on xlanguage 2.04 and 3.0)
comment out the folling line in include/functions.php
//$langs =& $GLOBALS["xlanguage_handler"]->getAll(true);

Add the folling line to the top of the xlanguage_ml() function in include functions.php
global $langs;

Add the folowing code to api.php
$langs =& $GLOBALS["xlanguage_handler"]->getAll(true);
just before the line :
ob_start("xlanguage_ml");


obviously a scope problem of some kind.
I am still curious if anyone alse has seen the same problem on php5.2 ? and why the problem appears on 5.2 and not on other php versions.

Kind regards,

Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
http://www.AnimalPedigree.com

3
il_berry
Re: xlanguage and php 5.2
  • 2009/10/25 23:48

  • il_berry

  • Just popping in

  • Posts: 7

  • Since: 2005/11/13


Hi!
I have the same problem.
Yesterday I have moved a XOOPS web site (2.013.2) with xlanguage from an hosting to another and a welcome blank page appeared...
Permission and all was ok. Difference? yes. old hosting php 4.4.7
The new one, php 5.2.0 -8+erch15

So... Highlander, thank you very very much for your solution.
I've searched for hours, and this is the unique post the solve the problem!
Thank you again

Stefano


Login

Who's Online

158 user(s) are online (51 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits