Part of the EllisLab Network
   
 
v 1.5.0.1: Fatal error: Cannot redeclare site_url()
Posted: 04 November 2006 03:03 PM   [ Ignore ]  
Summer Student
Total Posts:  3
Joined  07-02-2006

Hi,

I’ve upgraded my application from 1.4.1 (where it was working fine) to the latest 1.5.0.1 and got this error…

Fatal error: Cannot redeclare site_url() (previously declared in /var/www/virtual/mysite/htdocs/system/helpers/url_helper.php:40) in /var/www/virtual/mysite/htdocs/system/helpers/url_helper.php on line 40

Any ideas where this may come from?

Thanks!

Profile
 
 
Posted: 06 November 2006 04:36 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  254
Joined  10-04-2006

I think this error comes from the changes in CI::loader.
It is not anymore a require_once but a require if i do remember well.

Are you loading the helper you didi already autoloaded or something like that ?
Do you have another site_url function or method somewhere else ?

 Signature 

Sylvain Gourvil
PHP Developer
French scuba divingMotivation and team building

Profile
 
 
Posted: 06 November 2006 06:43 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  481
Joined  03-08-2006

I think you have loaded the URL Helper more than once (check autoload and the controller + it’s functions where the error happens).

 Signature 

Flickr | Last.fm | Del.icio.us

Profile
 
 
Posted: 06 November 2006 03:29 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  12
Joined  07-04-2006

I’ve the same problem using CI 1.5. My views worked fine with CI 1.4, but not now.
I gave a quick look and Loader.php. Double helper loading is supposed to be avoided using a array (_ci_helpers) but I doesn’t work. I guess that’s because the array is not shared through different instance of the Controller class.

Profile
 
 
Posted: 06 November 2006 05:54 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  3
Joined  07-02-2006
Craig - 06 November 2006 06:43 AM

I think you have loaded the URL Helper more than once (check autoload and the controller + it’s functions where the error happens).

This is what I’ve initially thought, but couldn’t find the instance of loading it second time… I’ve made temporary fix in Loader.php but I’m not quite happu not knowing the real reason behind this. Will have another look.

Thanks for the help.

Profile
 
 
Posted: 06 November 2006 06:44 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

The loader was supposed to keep track of each item being loaded to prevent this type of thing but there was a bug.  Grab a new download and replace Loader.php.  It should cure the problem.  I hope, anyway… grin

 Signature 
Profile
MSG
 
 
Posted: 07 November 2006 03:08 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  12
Joined  07-04-2006

Yes, it does fix it.

Thanks.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64453 Total Logged-in Users: 17
Total Topics: 80961 Total Anonymous Users: 0
Total Replies: 435694 Total Guests: 204
Total Posts: 516655    
Members ( View Memberlist )