MilesWeb Hosting Forum

Web Hosting Technical Support => Errors and Solutions => Topic started by: Dipak Bhoi on October 12, 2014, 06:56:22 PM

Title: Fatal error: Cannot redeclare quoted_printable_encode() in vcard.class.php
Post by: Dipak Bhoi on October 12, 2014, 06:56:22 PM
Hello Guys,

After browsing your joomla site you are receiving an error as below.

QuoteFatal error: Cannot redeclare quoted_printable_encode() in /home/username/public_html/site/includes/vcard.class.php on line 74

Don't worry, i have a solution for you. 

In vcard.class.php around line 36 is the function quoted_printable_encode. This ends up declaring twice, causing the error, so you can prevent the error and fix the error by checking if the function already exists, and if it does, PHP ignores the function declaration. Adding the glow lines of code before and after the existing function clears the problem.

if(!function_exists('quoted_printable_encode')) {
function quoted_printable_encode($input, $line_max=76) {
/* ... */
}
}

Now refresh your page, website should be run smoothly.  That's all.

Enjoy !!