Title: Fatal error: undefined function download_url
Last modified: August 24, 2016

---

# Fatal error: undefined function download_url

 *  Resolved [yk11](https://wordpress.org/support/users/yk11/)
 * (@yk11)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/)
 * Started receiving the above error today.
 * Fixed by replacing the download_url call with the following in wp-slimstat.php:
   1191:
    // Download the most recent database directly from MaxMind’s repository
   $url = ‘[http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz&#8217](http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz&#8217);;
   $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,
   1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $maxmind_tmp = curl_exec($ch);
   curl_close($ch);
 * [https://wordpress.org/plugins/wp-slimstat/](https://wordpress.org/plugins/wp-slimstat/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [hiflyman](https://wordpress.org/support/users/hiflyman/)
 * (@hiflyman)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029545)
 * My website also went down today due to a slimstst error. Had to get the hosting
   company to deactivate plugin to bring site back up.
 * They quoted the following error line in the programming as being at fault.
 * UTC] PHP Fatal error: Call to undefined function download_url() in /home4/ahighpho/
   public_html/wp-content/plugins/wp-slimstat/wp-slimstat.php on line 1188
 * Strange it should happen sometime after installing the latest version. Hope this
   info helps you to correct this.
 * I wonder if I have lost all logs because of this ?
 * Regards
 *  Thread Starter [yk11](https://wordpress.org/support/users/yk11/)
 * (@yk11)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029548)
 * You should not lose anything due to the error. SlimStats’s logs are in the database,
   so they are not deleted due to a simple error.
 * If you replace the line with the code I included the error should go away.
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029549)
 * Thank you, guys. We are looking into the issue. Sorry for the inconvenience:(
   And no, no existing data is lost because of this bug. You can also manually download
   that file, unzip it and upload it to wp-content/uploads/wp-slimstat where the
   existing one is.
 *  Thread Starter [yk11](https://wordpress.org/support/users/yk11/)
 * (@yk11)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029575)
 * May I suggest adding an admin option to specify an absolute path to the file?
   This would allow sharing a single file instance across multiple wordpress installs.
 *  [rjmclan](https://wordpress.org/support/users/rjmclan/)
 * (@rjmclan)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029639)
 * Just to add to the discussion.
    My site went “down” the other day. No page would
   be displayed. After sometime diagnosing the problem, we eventually found Slimstat
   to be the cause. I disable the plugin and all was well. I found this post and
   implemented yk11’s fix, re-enabled Slimstat and were back up. However I am receiving
   an alert bar regarding a location based service from Maxmind. I clicked the link
   to enable but received another alert saying it couldn’t unzip a file. I am guessing
   this has to do with permissions but I am not sure what level permissions need
   to be enabled and to which directory.
 * Other than that, thanks for the fix and love the plug-in.
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029657)
 * We’re working on a fix, thank you for pointing this out.
 *  [Arno007](https://wordpress.org/support/users/arno007/)
 * (@arno007)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029673)
 * Same problem here. Please hurry 😉
 * Thanks Arno
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029675)
 * Slimstat 3.9.9 should fix this problem.
 *  [Arno007](https://wordpress.org/support/users/arno007/)
 * (@arno007)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029677)
 * Thanks camu! For me this works now. Since in your comment you’ve mentioned it
   happened only to a few users: Only when I was not logged in to my site the error
   happened. Also I’m running iThemes security. Maybe this helps …
 * Thanks for the fix and cheers, Arno
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029686)
 * Thanks Arno. We are still trying to replicate the issue. IThemes doesn’t trigger
   the problem in our case.
 * Everyone, can you please list what plugins you are using, even by sending us 
   a private support request?
 * Thank you
    Camu

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Fatal error: undefined function download_url’ is closed to new replies.

 * ![](https://ps.w.org/wp-slimstat/assets/icon.svg?rev=2832242)
 * [SlimStat Analytics](https://wordpress.org/plugins/wp-slimstat/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-slimstat/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-slimstat/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-slimstat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-slimstat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-slimstat/reviews/)

 * 10 replies
 * 5 participants
 * Last reply from: [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/fatal-error-undefined-function-download_url/#post-6029686)
 * Status: resolved