Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7841495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:06:48+00:00 2026-06-02T16:06:48+00:00

I run a number of sites across different servers. On some servers, the Apache

  • 0

I run a number of sites across different servers. On some servers, the Apache server has the GeoIP module installed so that I can find out their location via their IP address. For example, to get their country name, I can do this:

$countryName = apache_note("GEOIP_COUNTRY_NAME");

However, on some servers that do not use the GeoIP module, this seems to cause troubles.

It seems that checking to see if $countryName comes back empty testing if apache_note("GEOIP_COUNTRY_NAME") exists with isset() is not good enough. I seem to just get HTML rendering failures without any error messages.

So, is there a way I can make an if statement in PHP to test to see if that GeoIP module exists in Apache?

(Note that on the servers where the GeoIP module is not installed I do not have access to the Apache settings, so installing the module is not an option.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:06:49+00:00Added an answer on June 2, 2026 at 4:06 pm

    You should be able to use apache_get_modules http://php.net/manual/en/function.apache-get-modules.php to see if the module is loaded. Just check to see if the module is in the returned array. This apparently doesn’t work if you are are calling PHP as a CGI though.

    $mods = apache_get_modules();
    
    if (array_search('mod_geoip',$mods)){
       print "GEO IP exist";
    }else{
       print "GEO IP Doesn't Exist";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web server that responds to a number of different sites on
I've run across an interesting PHP/SOAP error that has me stymied. After searching I
We have an application that has been deployed to 50+ websites. Across these sites
For a number of sites that are functioning normally, when I run them through
We run a number of web applications written in PHP. Unfortunately there are some
I have a number of reports that need to be both run separately and
Can I run a select statement and get the row number if the items
I have a number of reports that I run against my database that need
I read quite a number of posts of programmers that run into the Unable
How do I set form number four as the default form that will run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.