WordPress.org

Support

Support » Plugins and Hacks » Cookillian » [Resolved] Fatal PHP errors

[Resolved] Fatal PHP errors

  • I hope you can help me. I have just started to use your plugin but I noticed that I have repeated fatal errors in my php error log.

    I am running WP 3.5.2alpha and php 5.4.12. The theme is a very basic twenty twelve child.

    I have very few active plugins – Bullet Proof Security for one. I don#t have any active caching plugins.

    I have the latest Maxmind free geoip data for ipv4 and ipv6.

    The errors are

    [25-Mar-2013 22:36:03 UTC] PHP Fatal error:  Cannot redeclare geoip_country_code_by_name() in /home/xxx/public_html/yyy.com/wp-content/plugins/cookillian/vendor/MaxMind/geoip.inc on line 438
    [25-Mar-2013 22:36:03 UTC] PHP Fatal error:  Call to undefined function Myatu\WordPress\Cookillian\geoip_country_code_by_addr() in /home/xxx/public_html/yyy.com/wp-content/plugins/cookillian/app/Myatu/WordPress/Cookillian/Main.php on line 321

    I have the following script for twitter and facebook in the footer script section in the cookillian settings

    !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
    
    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));

    Do you have any ideas what could be causing the fatal error?

    Thanks.

    http://wordpress.org/extend/plugins/cookillian/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author myatu

    @myatu

    Hi,

    It looks like another plugin already has a function called geoip_country_code_by_name(), or in other words, is using the same MaxMind vendor library.

    I thought I had a check for this in Cookillian, but looking into this, I have not – so I considered it to be a minor bug.

    I will push out a bug fix when I have the time, or if you wish to do this yourself, simply edit the file /wp-content/plugins/cookillian/app/Myatu/WordPress/Cookillian/Main.php and on line 280, edit it as following:

    ...
            if (!function_exists('geoip_country_code_by_addr'))
                include_once $this->getPluginDir() . 'vendor/MaxMind/geoip.inc';
    ...

    As an alternative, if possible, you can look into using the mod_geoip module for Apache by MaxMind (see http://dev.maxmind.com/geoip/mod_geoip2) as it can handle much higher traffic loads and avoids having to use the vendor library.

    Hi Myatu,

    I am not aware of any other plugin that I am using that uses MaxMind geoip data. I had a look through BulletProofSecurity and found no reference to that function.

    However I am using Maxmind in Piwik but on a

      different

    add on domain which is under the same host user account.

    Here is the list of all my active plugins

    BulletProof Security
    Cookillian
    Fast Secure Contact Form
    Google XML Sitemaps
    Hotfix
    Limit Login Attempts
    Press This Reloaded
    WordPress Beta Tester
    WordPress Dashboard Twitter
    WordPress Database Backup
    WP to Twitter

    I’ll try your suggested code fix and then look into the mod_geoip module. I am on a shared server so I’m not sure how straightforward that will be.

    Thanks.

    Unfortunately the code change didn’t work.

    Here are the errors

    [26-Mar-2013 10:33:08 UTC] PHP Fatal error:  Cannot redeclare geoip_country_code_by_name() in /home/xxx/public_html/yyy.com/wp-content/plugins/cookillian/vendor/MaxMind/geoip.inc on line 438
    [26-Mar-2013 10:33:08 UTC] PHP Fatal error:  Call to undefined function Myatu\WordPress\Cookillian\geoip_country_code_by_addr() in /home/xxx/public_html/yyy.com/wp-content/plugins/cookillian/app/Myatu/WordPress/Cookillian/Main.php on line 323

    Line 323 in my modified Main.php is …

    $country = geoip_country_code_by_addr($this->maxmind_db, $ip);

    To eliminate the possibility (in my mind at least) that the cause was related to the .htaccess file changes that BulletProofsecurity makes I slected default htaccess in that plugin, cleared the cache, and reloaded the page. The same php errors were present.

    I am still confused as to where the MaxMind conflict is. Is there anything I can do to find this out?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Fatal PHP errors’ is closed to new replies.
Skip to toolbar