Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293241

Fatal error: Cannot redeclare render() in common.inc on line 5834 - Causing Internal Server Error 500

$
0
0

My website is afabengineering.com
I am not really a php programer
I am getting an internal server error 500 after moving the site to a new Virtualmin / Webmin hosting server (bluerubyhosting.com). I am sure I moved everything correctly, pointed the domain, imported the old database via phpmyadmin, and changed the settings.php database info correctly.

Below is the error I am getting in the error logs:
mod_fcgid: stderr: PHP Fatal error: Cannot redeclare render() in /home/afab/public_html/includes/common.inc on line 5834

I Googled this error and found a post about this error having something to do with graphviz-php which is a YUM package so I tried installing this graphviz-php YUM package in webmin and nothing changed. Here is the post I found on google that made me decide to try this idea.

I also tried disabling all my modules and themes by renaming them to see if they had anything to do with this and that did not do anything.

Below is the section of code being referred to in the error log the Cannot redeclare render() error in common.inc on line 5834

<?php
/**
* Renders an element.
*
* This function renders an element using drupal_render(). The top level
* element is shown with show() before rendering, so it will always be rendered
* even if hide() had been previously used on it.
*
* @param $element
*   The element to be rendered.
*
* @return
*   The rendered element.
*
* @see drupal_render()
* @see show()
* @see hide()
*/
function render(&$element) {
  if (
is_array($element)) {
   
show($element);
    return
drupal_render($element);
  }
  else {
    
//Safe-guard for inappropriate use of render() on flat variables: return
     //the variable as-is.
   
return $element;
  }
}
?>

I found another issue here on google that was even closer related to my issue but I could not quite understand the solution to the problem. Maybe someone here can enplane to me what zero13 was trying to say in his solution post.

I think its saying that this function on line 5854 in the common.inc file is being declared twice and that I just cannot redeclare the function. Should I wrap this section of code in some kind of if statement or something I looked up function.function-exists.php from php.net but I just don't understand it. I don't know what I should do. I'm not a php coder/programmer.

I really don't understand why this is happening because why would drupal core make a mistake like redeclaring a function twice in there php programming? Please help me solve this problem A-Fab Engineering is not happy that there site is down right now. I really appreciate any help and/or ideas I could get on this matter.

Oh yeah one more thing, I did try commenting out this line 5854 section of code in common.inc file and the Fatal error: Cannot redeclare render() error went away but I then got 2 other errors in the error log. So, I undid what I did because I don't want to make matters worse. Bellow are the few new errors I got after commenting out line 5854 section of code in common.inc

[Sat Apr 20 19:50:41 2013] [warn] [client 173.165.128.45] mod_fcgid: stderr: PHP Warning: Unterminated comment starting line 1956 in /home/afab/public_html/includes/common.inc on line 1956
[Sat Apr 20 19:50:41 2013] [warn] [client 173.165.128.45] mod_fcgid: stderr: PHP Fatal error: Call to undefined function _drupal_bootstrap_full() in /home/afab/public_html/includes/bootstrap.inc on line 2164
[Sat Apr 20 19:51:16 2013] [warn] [client 173.165.128.45] mod_fcgid: stderr: PHP Fatal error: Call to undefined function _drupal_bootstrap_full() in /home/afab/public_html/includes/bootstrap.inc on line 2164
[Sat Apr 20 19:57:08 2013] [warn] [client 173.165.128.45] mod_fcgid: stderr: PHP Fatal error: No matching function for overloaded 'render' in /home/afab/public_html/sites/all/themes/marinelli/templates/page.tpl.php on line 60


Viewing all articles
Browse latest Browse all 293241

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>