Page 1 of 1
[SOLVED]Fatal error: Cannot redeclare FileIcon()[SOLVED]
Posted: Fri Jan 24, 2014 8:18 am
by aldtsjerk
Hello,
Using cmsms 1.11.4.
After adding the plugin file_listing to the folder Plugins a error message
appears everytime I try to open the Pluginlist in m admin. This is the error message. The plugin file_list is also installed.
"Fatal error: Cannot redeclare FileIcon() (previously declared in /var/www/vhosts/xxxxxxxxxxx.nl/httpdocs/plugins/function.file_listing.php:406) in /var/www/vhosts/xxxxxx.nl/httpdocs/plugins/function.file_list.php on line 158"
Any idea on what couses this?
Re: Fatal error: Cannot redeclare FileIcon()
Posted: Fri Jan 24, 2014 9:34 am
by staartmees
Readfile is disabled by some hosts. You receive an error saying "cannot redeclare function" or something similar.
also see
http://dev.cmsmadesimple.org/bug/view/3794
Re: Fatal error: Cannot redeclare FileIcon()
Posted: Fri Jan 24, 2014 10:33 am
by Jo Morg
aldtsjerk wrote:"Fatal error: Cannot redeclare FileIcon() (previously declared in /var/www/vhosts/xxxxxxxxxxx.nl/httpdocs/plugins/function.file_listing.php:406) in /var/www/vhosts/xxxxxx.nl/httpdocs/plugins/function.file_list.php on line 158"
It seems obvious that you cant' use both plugins on the same installation as they both declare a function with the same name. Removing one of the plugins should fix this.
Re: Fatal error: Cannot redeclare FileIcon()
Posted: Fri Jan 24, 2014 11:00 am
by aldtsjerk
Hi Jo,
Thanks for the tip. It works.
You write "obvious" but how can you tell in front that this is the case. It is only after installing both plugins that you are able to find out.
Further more, there are quite some differences between the two plugins. So why give this function the same name in both cases? Inmy mind not very logical.
Thanks again.
Re: Fatal error: Cannot redeclare FileIcon()
Posted: Fri Jan 24, 2014 12:07 pm
by Jo Morg
aldtsjerk wrote:You write "obvious" but how can you tell in front that this is the case. It is only after installing both plugins that you are able to find out.

You can't. It's just obvious from the error message (hence my highlights in bold).
aldtsjerk wrote:Further more, there are quite some differences between the two plugins. So why give this function the same name in both cases? Inmy mind not very logical.
Probably different developers for each plugin and neither of them expected the other to use the same function name. There is a way to prevent that, of course, but that is a different discussion...
As it is solved, please add [Solved] to the beginning of the subject of the 1st topic.
