Fatal Error Cannot Redeclare Geoip_country_code_by_name
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 69 Star 329 Fork 206 maxmind/geoip-api-php Code Issues 1 Pull requests 1 Projects 0 Pulse Graphs New issue Fatal error:
Fatal Error Cannot Redeclare Geoip_country_name_by_name
Cannot redeclare geoip_country_code_by_name() when PHP geoip extension is enabled #6 Closed daigo75 opened magento cannot redeclare geoip_country_code_by_name this Issue Jul 26, 2013 · 7 comments Projects None yet Labels None yet Milestone No milestone geoip_country_code_by_name return false Assignees No one assigned 2 participants daigo75 commented Jul 26, 2013 If file geoip.inc is loaded in an environment where the geoip extension is enabled, the following error appears: Fatal error: Cannot redeclare
Geoip_country_code_by_name Not Working
geoip_country_code_by_name() This is due to the fact that both the geoip.inc and geoip extension declare such function, and no check is made to ensure that it doesn't already exists. MaxMind member oschwald commented Jul 29, 2013 Thanks for the report. How did you install the API? We already list the extension as a conflict in the composer.json file. daigo75 commented Jul 29, 2013 I'm not sure I understand the question correctly. I included the API (geop.inc etc) in a small software that I then package and distribute. The GeoIP library is included using Composer, but I can't predict if the environment where the package will be installed will contain the geoip php extension or not. Please note that, when my package is installed, Composer is not used to update the dependencies (nor it should be). Vendor libraries, including GeoIP, are simply included in the package, which is then just unzipped and executed "as is". MaxMind member oschwald commented Jul 29, 2013 Couldn't you check if the function exists before you load geoip.inc? daigo75 commented Jul 29, 2013 geoip.inc is loaded automatically by Composer, I don't have control over it. Also, that would not be a good workaround, because several, but not all of functions declared in geoip.inc match ones existing in geoip php extension. A better workaround, which is what I've done at the moment, if check for the existence of every single function in geoip.inc. This, however, is still rough and far from optimal. A better solution would be replacing global functions with classes, or using namespaces. I understand that this would hav
TroubleshooterAkeeba Backup for Joomla!Admin ToolsAkeeba Solo (Standalone)Akeeba Backup for WordPressTicket SystemKickstartRemote CLIUNiTEWalkthroughsWarningsJSON APIVideos Username Password Two Factor Authentication Key Remember Me Log in Forgot your username? Forgot your password? You need to be a subscriber in order to receive support. If you want to report a bug or ask a pre-sales question, you don't have to be a subscriber. Just use the Contact Us link at the footer of the site. Subscribe HomeSupportAdmin Tools#9904: PHP Fatal error: Cannot redeclare geoip_country_code_by_name #9904 – PHP Fatal error: Cannot redeclare geoip_country_code_by_name Posted in https://github.com/maxmind/geoip-api-php/issues/6 ‘Admin Tools’ This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information. Sunday, 19 June 2011 05:39 CDT leolll Mandatory information about my setup: Have I searched the forum before posting? Yes Have I read the Troubleshooting Wizard before posting? Yes Have I https://www.akeebabackup.com/support/admin-tools/9904-php-fatal-error-cannot-redeclare-geoip-country-code-by-name.html read the documentation before posting? Yes Joomla! version: 1.5.23 PHP version: 5 MySQL version: 5 Admin Tools Professional version: 2.0.5 Description of my issue: I installed the PHP PECL extension GeoIP (http://php.net/manual/en/book.geoip.php) and that caused the following error: PHP Fatal error: Cannot redeclare geoip_country_code_by_name() in /administrator/components/com_admintools/helpers/geoip.php on line 376 Once I fixed that issue, the next function also caused a problem so all I had to do was wrap the functions in a function_exists check, like this: if (!function_exists('geoip_country_code_by_name')) { function geoip_country_code_by_name($gi, $name) { $country_id = geoip_country_id_by_name($gi,$name); if ($country_id !== false) { return $gi->GEOIP_COUNTRY_CODES[$country_id]; } return false; } } if (!function_exists('geoip_country_name_by_name')) { function geoip_country_name_by_name($gi, $name) { $country_id = geoip_country_id_by_name($gi,$name); if ($country_id !== false) { return $gi->GEOIP_COUNTRY_NAMES[$country_id]; } return false; } } That fixed the Fatal Error issue. Sunday, 19 June 2011 07:11 CDT slaes JOOMLADELUXE are you using a commercial license for maxmind, by any chance. I've been meaning to play with it at some point, but from what i have read is most effective in
Download Documentation Documentation Screencasts Support General Support Community Forums Bug Tracker Contact Us Extensions Partners Community Forums Board index ‹ OpenCart 1.5+ Support ‹ General Support Change font size Print view Search FAQ Register https://forum.opencart.com/viewtopic.php?t=108926 Login Call to a member error only showing on certain browsers General support for technical problems with OpenCart v1.x Post a reply 3 posts • Page 1 of 1 Call to a member error only showing on certain browsers by jacksonkarlm » Wed Aug 28, 2013 1:20 pm currently the admin area of open cart functions fine on all browsers, but the front end only works on Mac/Firefox all other devices and browsers cannot redeclare show this error:Call to a member function get() on a non-object in /is/htdocs/wp11044915_TBGKSMPNAF/www/index.php on line 106here is a snippet of the code: if ($config->get('config_error_display')) { echo '' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline . ''; } if ($config->get('config_error_log')) { $log->write('PHP ' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line fatal error cannot ' . $errline); } return true;Anyone able to help ? jacksonkarlm Posts: 5Joined: Tue Aug 21, 2012 7:49 pm Top Re: Call to a member error only showing on certain browsers by ogun » Wed Aug 28, 2013 2:50 pm Does it definitely work on the Mac - could you be looking at Firefox's cached page? ...and are you working with a custom template or the default?Seeing a PHP error in one browser but not another usually suggests that some $_GET or $_POST value from the browser isn't being sent correctly - which probably means that your HTML or JavaScript is being interpreted differently by the browser and needs fixing, and that there's also something wrong with the PHP because it should be able to deal with that gracefully.The lines you've pasted are from within an error handling function - searching the forums (after a few utterly useless results) gives this thread: viewtopic.php?t=13686#p387647 ...where paulfeakins makes the very sensible suggestion of commenting out the call to the error handler to see where the actual error is occurring. See the thread for details but you're basically going to what's probably line 118 of index.php and commenting out "set_error_handler('error_handler');".Before you try that, try clearing out your vqmod cache as rajithg suggests in the same thread.Another thing t