Title: PHP Warning: Undefined array key &#8220;SERVER_PORT&#8221; in
Last modified: November 15, 2021

---

# PHP Warning: Undefined array key “SERVER_PORT” in

 *  Resolved [ramnaz19](https://wordpress.org/support/users/ramnaz19/)
 * (@ramnaz19)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-server_port-in/)
 * Hi Support
 * Migrated to PHP 8 and get the following error, when I use this plugin.
 * 13-Nov-2021 04:37:24 UTC] PHP Warning: Undefined array key “SERVER_PORT” in /
   home/userx/wp-content/plugins/ip-location-block/classes/class-ip-location-block-
   logs.php on line 686
 * The same plugin works on in PHP7.4.
 * Cheers
    Ramsy

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

 *  Plugin Author [Darko G.](https://wordpress.org/support/users/darkog/)
 * (@darkog)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-server_port-in/#post-15086893)
 * Hi [@ramnaz19](https://wordpress.org/support/users/ramnaz19/) ,
 * The issue has been fixed.
 * Best Regards,
    Darko
 *  Thread Starter [ramnaz19](https://wordpress.org/support/users/ramnaz19/)
 * (@ramnaz19)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-server_port-in/#post-15089127)
 * Hi [@darkog](https://wordpress.org/support/users/darkog/),
 * Thanks for resolving this issue. I have upgraded to the latest version and can
   confirm the warning is no longer appearing in the error log file on centos/php8.
 * Cheers
    Ramsy

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

The topic ‘PHP Warning: Undefined array key “SERVER_PORT” in’ is closed to new replies.

 * ![](https://ps.w.org/ip-location-block/assets/icon-256x256.png?rev=2662027)
 * [IP Location Block](https://wordpress.org/plugins/ip-location-block/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ip-location-block/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ip-location-block/)
 * [Active Topics](https://wordpress.org/support/plugin/ip-location-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ip-location-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ip-location-block/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ramnaz19](https://wordpress.org/support/users/ramnaz19/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-server_port-in/#post-15089127)
 * Status: resolved