• Resolved wileycoyote78

    (@wileycoyote78)


    Hello,

    This plugin, as described, is perfect for my needs. Because on my local machine the IP auto detected was 127.0.0.1, I tried to test it on a development site I have. Unfortunately the plugin seems to not be working, or I am doing something wrong.

    The link I provided should send you to the page where I explain the problem in detail.

    I have tried deleting the plugin and reinstalling. I updated the BIN file using the plugin settings page and my token, as well as manually uploading the BIN file, (including the IPV6 version).

    On my local machine, the plugin works great, but not on my online host.

    Thanks for your help.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author IP2Location

    (@ip2location)

    Please print the $_SERVER variables for debugging purposes. Your server may injected incorrect forwarded-for header in this case.

    Thread Starter wileycoyote78

    (@wileycoyote78)

    I took the liberty of removing the “resolved” status, since the issue is not resolved yet.

    Here is the output of the $_SERVER array:

    $_SERVER[ 'SERVER_SOFTWARE' ]: Apache
    
    $_SERVER[ 'REQUEST_URI' ]: /test/
    
    $_SERVER[ 'PATH' ]: /sbin:/usr/sbin:/bin:/usr/bin
    
    $_SERVER[ 'DOCUMENT_ROOT' ]: /home/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'SCRIPT_NAME' ]: /index.php
    
    $_SERVER[ 'SCRIPT_FILENAME' ]: /home/www/develop.thefaithstrugglebus.com/index.php
    
    $_SERVER[ 'PHP_VERSION' ]: 8
    
    $_SERVER[ 'PYTHON_VERSION' ]: 35
    
    $_SERVER[ 'CHROOT_HOST' ]: 1
    
    $_SERVER[ 'SB' ]: 0
    
    $_SERVER[ 'PHP_FCGI_MAX_REQUESTS' ]: 500
    
    $_SERVER[ 'PHP_INI_SCAN_DIR' ]: /home/tmp/php
    
    $_SERVER[ 'PH3_SCRIPT_FILENAME' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com/index.php
    
    $_SERVER[ 'PH3_SCRIPT_NAME' ]: /index.php
    
    $_SERVER[ 'PH3_DOCUMENT_ROOT' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'QUERY_STRING' ]:
    
    $_SERVER[ 'REQUEST_METHOD' ]: GET
    
    $_SERVER[ 'SERVER_PROTOCOL' ]: HTTP/1.1
    
    $_SERVER[ 'GATEWAY_INTERFACE' ]: CGI/1.1
    
    $_SERVER[ 'REDIRECT_URL' ]: /test/
    
    $_SERVER[ 'REMOTE_PORT' ]: 7833
    
    $_SERVER[ 'SERVER_ADMIN' ]: [no address given]
    
    $_SERVER[ 'CONTEXT_DOCUMENT_ROOT' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'CONTEXT_PREFIX' ]:
    
    $_SERVER[ 'REQUEST_SCHEME' ]: http
    
    $_SERVER[ 'REMOTE_ADDR' ]: 174.212.172.25
    
    $_SERVER[ 'SERVER_PORT' ]: 80
    
    $_SERVER[ 'SERVER_ADDR' ]: 69.162.154.208
    
    $_SERVER[ 'SERVER_NAME' ]: develop.thefaithstrugglebus.com
    
    $_SERVER[ 'SERVER_SIGNATURE' ]:
    
    $_SERVER[ 'LD_LIBRARY_PATH' ]: /services/apache/lib/openssl-1.1.1/lib:/services/apache/lib/curl/lib/:/services/apache/lib/
    
    $_SERVER[ 'HTTP_SEC_GPC' ]: 1
    
    $_SERVER[ 'HTTP_DNT' ]: 1
    
    $_SERVER[ 'HTTP_UPGRADE_INSECURE_REQUESTS' ]: 1
    
    $_SERVER[ 'HTTP_COOKIE' ]: wp-settings-1=libraryContent%3Dbrowse; wp-settings-time-1=1672849311
    
    $_SERVER[ 'HTTP_CONNECTION' ]: close
    
    $_SERVER[ 'HTTP_ACCEPT_ENCODING' ]: gzip, deflate
    
    $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ]: en-US,en;q=0.5
    
    $_SERVER[ 'HTTP_ACCEPT' ]: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
    
    $_SERVER[ 'HTTP_USER_AGENT' ]: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0
    
    $_SERVER[ 'HTTP_HOST' ]: develop.thefaithstrugglebus.com
    
    $_SERVER[ 'HTTP_AUTHORIZATION' ]:
    
    $_SERVER[ 'vhost_ph3_PATH' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'SECURITY' ]: detect
    
    $_SERVER[ 'UID' ]: 255530
    
    $_SERVER[ 'UNIQUE_ID' ]: Y7YaF7Vny-VG_rtmEUyMGgAAAhc
    
    $_SERVER[ 'REDIRECT_STATUS' ]: 200
    
    $_SERVER[ 'REDIRECT_HTTP_AUTHORIZATION' ]:
    
    $_SERVER[ 'REDIRECT_vhost_ph3_PATH' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'REDIRECT_DOCUMENT_ROOT' ]: /services/users/zstorage10p1/wileycoyote/www/develop.thefaithstrugglebus.com
    
    $_SERVER[ 'REDIRECT_SECURITY' ]: detect
    
    $_SERVER[ 'REDIRECT_SB' ]: 0
    
    $_SERVER[ 'REDIRECT_CHROOT_HOST' ]: 1
    
    $_SERVER[ 'REDIRECT_PYTHON_VERSION' ]: 35
    
    $_SERVER[ 'REDIRECT_PHP_VERSION' ]: 8
    
    $_SERVER[ 'REDIRECT_UID' ]: 255530
    
    $_SERVER[ 'REDIRECT_UNIQUE_ID' ]: Y7YaF7Vny-VG_rtmEUyMGgAAAhc
    
    $_SERVER[ 'FCGI_ROLE' ]: RESPONDER
    
    $_SERVER[ 'PHP_SELF' ]: /index.php
    
    $_SERVER[ 'REQUEST_TIME_FLOAT' ]: 1672878615.6464
    
    $_SERVER[ 'REQUEST_TIME' ]: 1672878615

    Please let me know what if anything is off about this so I can contact my hosting provider if necessary.

    Once the issue is truly resolved, I will mark this thread as such. Thank you.

    Plugin Author IP2Location

    (@ip2location)

    I can’t see any variables that may cause IP detected as 127.0.0.1 from our headers. Please enable the Debugging log in the plugin and check the “debug.log” for the possible details.

    Thread Starter wileycoyote78

    (@wileycoyote78)

    Sorry for the confusion. 127.0.0.1 is from my LOCAL machine, where the plug-in is working fine if I input a real IP address to the main function. I only mentioned it as background as to how I got to testing it on a “live” site.

    The issue is on the LIVE server, which is the link I provided. Whether I pass it a valid IP or have the plug-in “auto check,” the JSON object comes back as NULL.

    is there a particular library or server module that the plugin relies on?

    Plugin Author IP2Location

    (@ip2location)

    It looks like the variables are not saved into $_SESSION. Can you dump the values for debugging?

    Thread Starter wileycoyote78

    (@wileycoyote78)

    This is all I got from $_SESSION (using a foreach loop to traverse the array):

    $_SESSION[ 'ip2location_variables_174.212.172.25' ]:

    And here is the var_dump version:

    array(1) { ["ip2location_variables_174.212.172.25"]=> string(0) "" }

    Here is debug.log… Obviously ignore the errors caused by CORE. The only stuff related to your plugin has to do with the IP2LOCATION_COUNTRY_SHORT key.

    [05-Jan-2023 02:09:56 UTC] PHP Warning:  Undefined array key "IP2LOCATION_COUNTRY_SHORT" in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 82
    [05-Jan-2023 02:10:07 UTC] PHP Warning:  Attempt to read property "countryCode" on bool in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 11
    [05-Jan-2023 02:10:07 UTC] PHP Warning:  Undefined array key "IP2LOCATION_COUNTRY_SHORT" in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 82
    [05-Jan-2023 02:10:58 UTC] PHP Warning:  Undefined array key "IP2LOCATION_COUNTRY_SHORT" in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 82
    [05-Jan-2023 04:49:38 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Cookie/Jar.php on line 63
    [05-Jan-2023 04:49:38 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Cookie/Jar.php on line 73
    [05-Jan-2023 04:49:38 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Cookie/Jar.php on line 89
    [05-Jan-2023 04:49:38 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Cookie/Jar.php on line 102
    [05-Jan-2023 04:49:38 UTC] PHP Deprecated:  Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Cookie/Jar.php on line 111
    [05-Jan-2023 04:49:39 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40
    [05-Jan-2023 04:49:39 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51
    [05-Jan-2023 04:49:39 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68
    [05-Jan-2023 04:49:39 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82
    [05-Jan-2023 04:49:39 UTC] PHP Deprecated:  Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/www/develop.thefaithstrugglebus.com/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
    [05-Jan-2023 04:49:39 UTC] PHP Warning:  Undefined array key "IP2LOCATION_COUNTRY_SHORT" in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 82
    [05-Jan-2023 04:52:12 UTC] PHP Warning:  Undefined array key "IP2LOCATION_COUNTRY_SHORT" in /home/www/develop.thefaithstrugglebus.com/wp-content/themes/faithyblog/page-test.php on line 82
    Plugin Author IP2Location

    (@ip2location)

    Looks like there is no geolocation result in the array. Can you look into the “debug.log” generated in the plugin folder?

    Thread Starter wileycoyote78

    (@wileycoyote78)

    Well, this is interesting. When I try to enable the log in the plugin settings, it won’t save the change after pressing “Save changes” button. If I leave the screen (i.e. go to General settings) and come back, the box is unchecked once more.

    On my laptop, this doesn’t happen. Comparing WordPress databases, the one on the live server is missing the ip2location_variables_debug_log_enabled entry in the options table, whereas the one on my local machine has this entry with a value of 1 (enabled).

    I manually entered a row into the table to try to enable the option, it worked in that now the settings screen shows it is enabled, but it still does not generate a debug.log file in the plugin folder. I have one in wp-content from enabling WP_DEBUG_LOG in wp-config.php.

    The plugin seems to not be connecting with the SQL DB on my live server very well. I uninstalled the plugin, but its entries were still there, so I deleted those too. I reinstalled the plugin, and it only reinserted ip2location_variables_database into the options table. Once again, checking the “Enable log” option does nothing.

    • This reply was modified 3 years, 3 months ago by wileycoyote78.
    Thread Starter wileycoyote78

    (@wileycoyote78)

    I AM AN INCREDIBLE IDIOT!!!!!! OH MY GOD!!!!

    I am SO SO SO SO sorry… This is a real ID10T error.

    On my local machine, I hadn’t realized I selected the Look up mode followed by hitting “Save changes,” which is what injected the options into the table, and the reason why it was working fine there.

    When I manually inserted the options on my live server, it started working. I then smacked my forehead very hard. I deleted the plugin, removed all the options from the DB again, and reinstalled. This time I selected the look up mode, updated the BIN file, and then hit “Save changes.”

    I feel very bad I wasted your time. But perhaps add that bit of instruction in the Settings screen so that morons like me don’t have this problem in the future?

    Thanks again for all your help, and once again I profusely apologize for wasting your time.

    Plugin Author IP2Location

    (@ip2location)

    Good to hear that! It’s great that the plugin is finally working.

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

The topic ‘Plugin is not finding the DB?’ is closed to new replies.