Page 1 of 7
Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sat Nov 21, 2009 11:54 am
by gokan
Hi,
I have succesfully installed Joomla 1.0.15 locally, then I clicked the button "View site" and received this message:
Warning: Parameter 2 to frontpage() expected to be a reference, value given in C:\xampp\htdocs\mambo\includes\Cache\Lite\Function.php on line 100
What Should I do?
Any help dear joomla Masters!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sun Jan 03, 2010 1:28 am
by Helvecio
gokan wrote:Hi,
I have succesfully installed Joomla 1.0.15 locally, then I clicked the button "View site" and received this message:
Warning: Parameter 2 to frontpage() expected to be a reference, value given in C:\xampp\htdocs\mambo\includes\Cache\Lite\Function.php on line 100
What Should I do?
Any help dear joomla Masters!
You probably have the same problem I have. I just found out one my client's site is down, due to an incompatibility between Joomla 1.x.x and current versions of PHP. My host company upgraded and I never thought this would happen. I'm SOOOOOOOO F******* MAAAD!!!
If this is the case, Install the latest version of Joomla and you'll be OK.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 04, 2010 5:58 am
by thethepapapa
There are certain features of the older version of Joomla our clients want to preserve and keep that are not compatible in the most recent version of Joomla. From my latest server upgrades, it appears that BOTH MySQL and PHP upgrades are causing this error. According to my records, the last stable server settings without issues were:
Apache version 2.2.14 (Unix)
PHP version 5.2.9
MySQL version 5.0.67-community
Moving to PHP 5.30 and MySQL 5.0.81-community blew out all my older Joomla sites.
Guess its either time to go dedicated server if I want to keep the sites as they were, or convince my shared server host to roll back on PHP and MySQL. Not fun, not fun at all!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Thu Jan 07, 2010 11:06 pm
by kjellhahlen
fix_joomla_10x_php_530.zip
I wrote a fix. My version is Joomla 1.0.13 but I suppose it will not be very different for later versions.
You sould replace two files by the ones in the attachment:
/includes/Cache/Lite/Function.php
(this solves the "Reference instead of value"-problem)
/includes/vcard.class.php
(to make the contact form work again)
If you rather add the changes by hand:
The changes to vcard.class.php are minor, look for:
Code: Select all
if(!function_exists('quoted_printable_encode'))
In Function.php I added a this line twice:
Code: Select all
$arguments = $this->fixCalls($arguments);
The new function (fixCalls) is added at the end of the file.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Fri Jan 08, 2010 3:03 am
by Helvecio
kjellhahlen wrote:fix_joomla_10x_php_530.zip
I wrote a fix. My version is Joomla 1.0.13 but I suppose it will not be very different for later versions.
You sould replace two files by the ones in the attachment:
IT WORKS!!!!!
Man, I can't thank you enough!!!!
ALL THE BEST!!! Kjellhahlen, YOU ROCK!!!!!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Fri Jan 08, 2010 6:13 pm
by bydosangel
Really i Can't Think Of a Great Thanks...
Thank you kjellhahlen
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sun Jan 10, 2010 5:19 am
by brichardson
kjellhahlen, you ROCK. I was freaking out over this, and then I came across your fix! 5 minutes later and I'm up again.
Guess it's time to upgrade the site to the latest, greatest Joomla.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sun Jan 10, 2010 7:41 pm
by henricloven
You really saved me a lot of time by supplying this fix. Then we don't need to hurry in the transition to Joomla 1.5
But I had to do the additions to Function.php manually because I could not get your supplied file to work on my joomla installation. Details below.
PHP built On: Linux srv150 2.6.26-2-vserver-amd64 #1 SMP Thu Nov 5 03:47:07 UTC 2009 x86_64
Database Version: 5.0.51a-24+lenny2-log
PHP Version: 5.3.1
Web Server: Apache
WebServer to PHP interface: cgi-fcgi
Joomla! Version: Joomla! 1.0.13 Stable [ Sunglow ] 21 July 2007 16:00 UTC
THANKS!!!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sun Jan 10, 2010 10:02 pm
by Helvecio
henricloven wrote:You really saved me a lot of time by supplying this fix. Then we don't need to hurry in the transition to Joomla 1.5
But I had to do the additions to Function.php manually because I could not get your supplied file to work on my joomla installation. Details below.
THANKS!!!
Did you put
Function.php in the right place?
I misplaced it the first time uploaded the file. Better double-check.
G'luck!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 11, 2010 2:19 pm
by luis23045
Well I did not even new about this post until one of my clients using Joomla 1.0 went down as everyone in here. But I'm glad you guys came with this post. Now as everyone should do, upgrade is a must. Thanks again for sharing that fix php 3 for old Joomla.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 11, 2010 5:01 pm
by henricloven
Helvecio wrote:henricloven wrote:You really saved me a lot of time by supplying this fix. Then we don't need to hurry in the transition to Joomla 1.5
But I had to do the additions to Function.php manually because I could not get your supplied file to work on my joomla installation. Details below.
THANKS!!!
Did you put
Function.php in the right place?
I misplaced it the first time uploaded the file. Better double-check.
G'luck!
File was placed as instructed in /includes/Cache/Lite/Function.php
But it did not work for the frontPage. I haven't had time to fully compare the supplied file with my modified one yet so I can't say what caused it.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 11, 2010 6:32 pm
by doschtinator
Thanks kjellhahlen!!!
I had the problem today and searched for a solution, because i never had this before ...
I found this forum an it really works!!! I´m using Joomla 1.0.15 and as you wrote it works for this version too.
Thanks again and bye!
Greetings doschtinator
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 11, 2010 9:06 pm
by Kubanek
Good one! Thanks it worked (so far)
.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Tue Jan 12, 2010 3:36 pm
by atzounis
Great job!!!
Thanks a lot
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Wed Jan 13, 2010 10:07 pm
by kjellhahlen
Glad I could help
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Fri Jan 15, 2010 12:56 am
by hhallii
Helvecio wrote:kjellhahlen wrote:fix_joomla_10x_php_530.zip
IT WORKS!!!!!
Man, I can't thank you enough!!!!
ALL THE BEST!!! Kjellhahlen, YOU ROCK!!!!!
This fix just saved my A$$!
The problem had me and my host stumped... completely stumped.
My joomla is 1.012.
Big Thank you!!
Re: need fix with other related messages.
Posted: Fri Jan 15, 2010 11:43 am
by marckpy2
kjellhahlen wrote:Glad I could help
Thanks for your help kjellhahlen !
but.. i still have this message after change with that fix.
my joomla says in frontpage
"Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/sef.php on line 533"
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/templates/rt_replicant
/rt_moomenu.php on line 149
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/pathway.php on line 313
i check double where i replace the files and that part is ok.
Any help?
this happen too, when my host upgrade they php.
Gracias.
Re: need fix with other related messages.
Posted: Fri Jan 15, 2010 12:42 pm
by kjellhahlen
marckpy2 wrote:
my joomla says in frontpage
"Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/sef.php on line 533"
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/templates/rt_replicant
/rt_moomenu.php on line 149
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/pathway.php on line 313
That is actually another problem, but indeed also related to PHP 5.3. It might belong in a seperate thread.
The fix I provided does fix the errors on your site the original poster mentioned. To fix the "eregi"-error you can do two things:
- The error you are getting is not
really an error, it is a warning to programmers to do not use this function anymore. Although erigi is deprecated your website will function. Most webhosts provide a setting on the control panel to disable error reporting, which should stop warnings like this. Of course this is not really a fix
, and there a better ways! But if you keep getting this message in all kind of places on your website, or you are reluctant to edit php code, it might be a simple way to keep things going.
- The better way: fixing the code. You should edit the files you mentioned, and scroll to the line number the error appears. The keyword eregi should be replaced by preg_match and the syntax should change a bit:
Code: Select all
eregi('SOMESTRING', something, somethingelse);
should become
Code: Select all
preg_match('/SOMESTRING/i', something, somethingelse);
As you can see it is not a big change. Notice that SOMESTRING is beween "/" and "/i" now. All the parameters after that stay the same. I don't know how your php is
, but this of course is the best way by far to fix things.
Look here for more information on the issue:
http://devthought.com/tumble/2009/06/fi ... in-php-53/
If you run into trouble, post the lines of code your error messages mention and I will post back the updated code.
Good luck!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sat Jan 16, 2010 8:06 pm
by ramyag539
I had the same problem as I was using joomla 1.0. Thank You very much for the .zip files. It worked!!!!! You're gr8...
Re: need fix with other related messages.
Posted: Mon Jan 18, 2010 4:42 pm
by marckpy2
kjellhahlen wrote:marckpy2 wrote:
my joomla says in frontpage
"Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/sef.php on line 533"
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/templates/rt_replicant
/rt_moomenu.php on line 149
and
Deprecated: Function eregi() is deprecated in /home/mart/public_html/includes/pathway.php on line 313
That is actually another problem, but indeed also related to PHP 5.3. It might belong in a seperate thread.
The fix I provided does fix the errors on your site the original poster mentioned. To fix the "eregi"-error you can do two things:
- The error you are getting is not
really an error, it is a warning to programmers to do not use this function anymore. Although erigi is deprecated your website will function. Most webhosts provide a setting on the control panel to disable error reporting, which should stop warnings like this. Of course this is not really a fix
, and there a better ways! But if you keep getting this message in all kind of places on your website, or you are reluctant to edit php code, it might be a simple way to keep things going.
- The better way: fixing the code. You should edit the files you mentioned, and scroll to the line number the error appears. The keyword eregi should be replaced by preg_match and the syntax should change a bit:
Code: Select all
eregi('SOMESTRING', something, somethingelse);
should become
Code: Select all
preg_match('/SOMESTRING/i', something, somethingelse);
As you can see it is not a big change. Notice that SOMESTRING is beween "/" and "/i" now. All the parameters after that stay the same. I don't know how your php is
, but this of course is the best way by far to fix things.
Look here for more information on the issue:
http://devthought.com/tumble/2009/06/fi ... in-php-53/
If you run into trouble, post the lines of code your error messages mention and I will post back the updated code.
Good luck!
Man, i fix it !!!
i can't believe that i don't need to make the upgrade process to 1.5.
THANKS MAN !!!
but, that fix have a partial solution because, i have others problem with functions like ereg and split that have changed too and replaced with preg_match and explode respectively.
ON THE OTHER HAND, i have a ONE PROBLEM MORE, that i can't find answers on the forum,
this is it:
Deprecated: Assigning the return value of new by reference is deprecated in /home/martastr/public_html/includes/PEAR/PEAR.php on line 563
i look on that code line and appear this:
Code: Select all
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
return $data->getMessage() == $code;
} else {
return $data->getCode() == $code;
}
}
return false;
i don't know what code to change to dissapear this error.
can you help me ? AGAIN ?!!!!!!!!!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 18, 2010 8:10 pm
by kjellhahlen
That error doesn't make much sense with the line of code you posted. Are you sure you looked at the right place? If I open that file (with Joomla 1.0.13), line 563 shows:
Code: Select all
$a = &new $ec($code, $mode, $options, $userinfo);
Before the word "new" there is a reference sign (&), exactly what PHP is complaining about. Change "&new" into "new" and you will be fine (I suppose, I didn't test it, so backup). Make sure you do it for the whole file, there a more occurences.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 18, 2010 11:11 pm
by NeQo
kjellhahlen wrote:fix_joomla_10x_php_530.zip
I wrote a fix. My version is Joomla 1.0.13 but I suppose it will not be very different for later versions.
You sould replace two files by the ones in the attachment:
/includes/Cache/Lite/Function.php
(this solves the "Reference instead of value"-problem)
/includes/vcard.class.php
(to make the contact form work again)
If you rather add the changes by hand:
The changes to vcard.class.php are minor, look for:
Code: Select all
if(!function_exists('quoted_printable_encode'))
In Function.php I added a this line twice:
Code: Select all
$arguments = $this->fixCalls($arguments);
The new function (fixCalls) is added at the end of the file.
kjellhahlen, you really saved the day.
I use Mambo 4.6.5, and my admin page got screwed up with the release and update of php 5.3 on my server.
Your vcard.class.php fix works also great with me...!!
To a big THANK YOU.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Tue Jan 19, 2010 11:24 am
by marckpy2
kjellhahlen wrote:That error doesn't make much sense with the line of code you posted. Are you sure you looked at the right place? If I open that file (with Joomla 1.0.13), line 563 shows:
Code: Select all
$a = &new $ec($code, $mode, $options, $userinfo);
Before the word "new" there is a reference sign (&), exactly what PHP is complaining about. Change "&new" into "new" and you will be fine (I suppose, I didn't test it, so backup). Make sure you do it for the whole file, there a more occurences.
Hi man, thanks for your reply.
My line on 563 is that i wrote. (one part of them, i pasted all the codes between 560 and 570)
i have joomla 1.0.15. No matters. Your info looks useful because i will look for "&new" and i will replace with "new"
is only that function that i need to change?
the ampersand is just removed. i will look for the entire page and i will everything replace like you say.
thank you. again.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Sun Jan 24, 2010 3:14 pm
by kjellhahlen
For now that's the only thing you need to replace. If you get other errors we'll see about those later. Does it solve the issue?
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Mon Jan 25, 2010 12:16 pm
by nemobluesix
Hello all and many thanks kjellhahlen.
The fix posted above by kjellhahlen works also for mambo users with the same problem. I spent a few days trying to solve this until I found this post. It may help others to know.
Thank again
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Wed Jan 27, 2010 9:14 pm
by roysv
Thanx kjellhahlen,
U saved me for a very long night after I found out that my host did the upgrade.
Roy
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Thu Jan 28, 2010 9:37 am
by Jesper1
Dahm you good! Thank you sooo muuuuuuuch!!!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Thu Jan 28, 2010 12:52 pm
by stianhaugli
kjellhalen,
thank you so much (!). Your fix worked nicely with our Joomla 1.0.15 site after one.com's unannounced upgrade to php 5.3 yesterday.
(I did the manual patch as you suggested..)
You saved me weeks worth not yet having to upgrade our heavily modded site to 1.5.15. I would buy you a beer, even two, if i could
THANK YOU!
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Thu Jan 28, 2010 3:07 pm
by smoby123
@kjellhahlen
I could not thank you enough for that patch. I'm very very greatfull. Like others you really saved me a lot time.
And with stianhaugli i would buy you a couple of beers.
Thank you very much for sharing this with us.
Re: Warning: Parameter 2 to frontpage() expected to be a referen
Posted: Fri Jan 29, 2010 11:07 pm
by kjellhahlen
Great! More beer!
Again, glad to have helped. Nice to hear the fix is useful to some people!
Best of luck,
Kjell Hählen