Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jan 2012 at 15:31 UTC
Updated:
2 Apr 2015 at 10:39 UTC
Jump to comment: Most recent
Comments
Comment #1
nod_Looks like it wasn't a brand new install after all. If this was the case they'd be another release already.
Did you install in a clean directory too ? looks like you have some leftover files around.
Comment #2
Anonymous (not verified) commenteddo you have other modules installed? i can't reproduce this on a fresh install from current git 7.x, there is definitely only one render function in core.
that php error often points to where the first declaration of the function lives, like this (where i stuck function render() {} in index.php):
Fatal error: Cannot redeclare render() (previously declared in /var/www/drupal7/webroot/index.php:14) in /var/www/drupal7/webroot/includes/common.inc on line 5834
final stab in the dark - can you reproduce this after restarting apache? i've seen this error from APC sometimes, and restart (or clearing the APC cache) fixes it.
Comment #3
catchLooks like a crosspost.
Comment #4
ChrisValentine commentedIt was a completely new install in a completely empty folder - so no leftover files and no other modules. I didn't solve the issue - instead I just copied an existing install of the same version and worked from that.
Interesting about the Apache restart though.
And I've certainly not cross posted this elsewhere.
Comment #5
DamianD commentedI managed to fix this error by disabling the graphviz-php extension module
Comment #6
marcoka commentedthis is definitely caused by graphviz php extension. problem is wel some people need it, so disabling is not a solution.
pretty ugly. any solutions (not disabling the gv.so module)
#1408224: Fatal error: Cannot redeclare render() in /var/www/.../includes/common.inc on line 5757
drupal just defines render() and the gv.so does to. great and BOOK -> WSOD
Comment #7
catchNot sure how this can be backported, but that seems like a major oops to me.
Comment #8
marcoka commentedthis is realated and jbrown suggested solutions.
#1370032: render() function defined by other PHP libraries
#1393208: Namespace all Drupal PHP code (esp. procedural)
Comment #9
drebroff commentedConfirm crash (d7.14) with graphviz php extension.
Comment #10
chx commentedWon't / can't fix for D7, Twig will fix it for D8. I can't even find this extension and I am not happy about supporting every fly-by php extension someone puts on the Internet. I left this open but unless someone has a really really good argument against this then the fault is at graphviz. Every sane PHP extension namespaces. apc_add. hash_hmac. etc.
Comment #11
marcoka commenteddetailed info
http://www.graphviz.org/
The php extension of graphviz classes: http://www.graphviz.org/pdf/gv.3php.pdf
Its part of the scripting api that comes as an *.so file to load inside the php.ini.
I get that this can not be fixed in D7 because renaming functions is not possible. If D8 uses namespaces great.
It is not only this special extension. Any lib/extension can be problematic if it uses render(). In my opinion its the fault of both graphviz and drupal for just using render() with no namespace. Graphvizs lib even uses more such "common" names like graph().
Solution
I first tried forking the c++ library, but well ... disaster :). I myself then solved the problem with forking the php graphviz pear package and using this lib instead of directly using the .so lib to directly use graphviz api.
http://pear.php.net/package/Image_GraphViz/
Comment #12
chx commentedWell, then this is a won't fix.
Comment #13
marcoka commentedits just not a good idea to use just such non specific names. there will be more scripts that will do this.
if everybody does that nothing will be compatible...
in d8 there is namespaces right? if so it is fixed there?
Comment #14
fabianx commentedUnfortunately it was not fixed in the D8 cycle as we still support the phptemplate engine.
Comment #15
marcoka commentedgreat...so still hacking