Warning: Parameter 2 to frontpage() expected to be a referen

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
gokan
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Nov 20, 2009 7:07 pm

Warning: Parameter 2 to frontpage() expected to be a referen

Post by gokan » Sat Nov 21, 2009 11:54 am

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!

User avatar
Helvecio
Joomla! Explorer
Joomla! Explorer
Posts: 468
Joined: Wed Oct 10, 2007 2:29 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by Helvecio » Sun Jan 03, 2010 1:28 am

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.
Helvecio "Elvis" da Silva
Graphic and Web Designer
Joomla Website Developer
http://hlvc.design

User avatar
thethepapapa
Joomla! Intern
Joomla! Intern
Posts: 84
Joined: Thu Aug 18, 2005 2:00 pm
Location: Somewhere in the land between

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by thethepapapa » Mon Jan 04, 2010 5:58 am

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!
If the freedom of speech is taken away then dumb and silent we may be led, like sheep to the slaughter.
-- George Washington --

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by kjellhahlen » Thu Jan 07, 2010 11:06 pm

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.
You do not have the required permissions to view the files attached to this post.
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl

User avatar
Helvecio
Joomla! Explorer
Joomla! Explorer
Posts: 468
Joined: Wed Oct 10, 2007 2:29 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by Helvecio » Fri Jan 08, 2010 3:03 am

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!!!!!
Helvecio "Elvis" da Silva
Graphic and Web Designer
Joomla Website Developer
http://hlvc.design

bydosangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Wed Nov 28, 2007 8:46 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by bydosangel » Fri Jan 08, 2010 6:13 pm

Really i Can't Think Of a Great Thanks...

Thank you kjellhahlen

brichardson
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Mar 15, 2008 7:02 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by brichardson » Sun Jan 10, 2010 5:19 am

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.

henricloven
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Jan 10, 2010 7:14 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by henricloven » Sun Jan 10, 2010 7:41 pm

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!!!

User avatar
Helvecio
Joomla! Explorer
Joomla! Explorer
Posts: 468
Joined: Wed Oct 10, 2007 2:29 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by Helvecio » Sun Jan 10, 2010 10:02 pm

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!
Helvecio "Elvis" da Silva
Graphic and Web Designer
Joomla Website Developer
http://hlvc.design

luis23045
Joomla! Explorer
Joomla! Explorer
Posts: 459
Joined: Mon Mar 09, 2009 9:54 am
Location: Dallas, TX
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by luis23045 » Mon Jan 11, 2010 2:19 pm

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.
http://cmsteachings.com - Joomla Tips & Tutorials
http://ubrainmedia.com - My Joomla Company
My Joomla Advice is my personal experience. It does not means I am right or wrong. It just means that I work with Joomla in my own way and it works for me.

henricloven
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Jan 10, 2010 7:14 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by henricloven » Mon Jan 11, 2010 5:01 pm

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.

doschtinator
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jan 11, 2010 6:22 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by doschtinator » Mon Jan 11, 2010 6:32 pm

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

Kubanek
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jan 11, 2010 8:56 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by Kubanek » Mon Jan 11, 2010 9:06 pm

Good one! Thanks it worked (so far) :).

User avatar
atzounis
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Mon Oct 08, 2007 2:02 pm
Location: Greece
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by atzounis » Tue Jan 12, 2010 3:36 pm

Great job!!!
Thanks a lot

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by kjellhahlen » Wed Jan 13, 2010 10:07 pm

Glad I could help :)
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl

User avatar
hhallii
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Jan 15, 2010 12:38 am

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by hhallii » Fri Jan 15, 2010 12:56 am

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!!
"These go to eleven."

marckpy2
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Jan 14, 2010 10:40 pm

Re: need fix with other related messages.

Post by marckpy2 » Fri Jan 15, 2010 11:43 am

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.

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: need fix with other related messages.

Post by kjellhahlen » Fri Jan 15, 2010 12:42 pm

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!
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl

ramyag539
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Jan 16, 2010 7:55 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by ramyag539 » Sat Jan 16, 2010 8:06 pm

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...

marckpy2
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Jan 14, 2010 10:40 pm

Re: need fix with other related messages.

Post by marckpy2 » Mon Jan 18, 2010 4:42 pm

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 ?!!!!!!!!! :p

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by kjellhahlen » Mon Jan 18, 2010 8:10 pm

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.
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl

NeQo
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jan 18, 2010 10:46 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by NeQo » Mon Jan 18, 2010 11:11 pm

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.

marckpy2
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Jan 14, 2010 10:40 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by marckpy2 » Tue Jan 19, 2010 11:24 am

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.

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by kjellhahlen » Sun Jan 24, 2010 3:14 pm

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?
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl

nemobluesix
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jan 25, 2010 12:03 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by nemobluesix » Mon Jan 25, 2010 12:16 pm

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

roysv
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jan 27, 2010 8:49 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by roysv » Wed Jan 27, 2010 9:14 pm

Thanx kjellhahlen,

U saved me for a very long night after I found out that my host did the upgrade.

Roy

Jesper1
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jan 28, 2010 8:41 am

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by Jesper1 » Thu Jan 28, 2010 9:37 am

Dahm you good! Thank you sooo muuuuuuuch!!!

stianhaugli
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Jun 16, 2008 9:11 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by stianhaugli » Thu Jan 28, 2010 12:52 pm

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!

smoby123
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 13, 2010 12:08 pm

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by smoby123 » Thu Jan 28, 2010 3:07 pm

@kjellhahlen

:D 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.

kjellhahlen
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jan 07, 2010 10:43 pm
Location: Almere, The Netherlands
Contact:

Re: Warning: Parameter 2 to frontpage() expected to be a referen

Post by kjellhahlen » Fri Jan 29, 2010 11:07 pm

Great! More beer! :D

Again, glad to have helped. Nice to hear the fix is useful to some people!

Best of luck,
Kjell Hählen
Kjell Hählen
KaliMera Webdesign en Solutions - http://www.kalimerawebdesign.nl


Locked

Return to “Installation - 1.0.x”