[Sahana_proj] fatal error and fix

de Lanerolle, Trishan R. Trishan.deLanerolle at trincoll.edu
Fri Nov 24 21:12:14 EST 2006


Hi Guys,
Just wanted to pass along the following coding lesson. If you come across the following error, it is due to a file getting included twice. This could happen if you call a .inc inside another and both contain calls  to shared library or another inc file. 
 
Fatal error: Cannot redeclare get_manager_id() (previously declared in /usr/share/sahana_deploy/sahana_nov24/mod/vm/utility_functions.inc:28) in /usr/share/sahana_deploy/sahana_nov24/mod/vm/utility_functions.inc on line 34

The fix is to use include_once() or require_once() instead of include(). This would force php to load the library once. 

This is a good example of the type of problem, that if you run into is worth sharing with the group. Even if you haven't found the fix.
Have a good weekend,
Trishan


HINT: If you use Linux terminal the grep command is your friend to do text search across multiple files.  



Trishan de Lanerolle'04
Computer Science/Engineering
Technology Coordinator
Systems and Networking
LITC B35
Trinity College
(860) 297 5313




More information about the Sahana_proj mailing list