Title: PHP Fatal Errors in frontend.php Causing 405 Server Errors
Last modified: September 15, 2025

---

# PHP Fatal Errors in frontend.php Causing 405 Server Errors

 *  [rodono419](https://wordpress.org/support/users/rodono419/)
 * (@rodono419)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/php-fatal-errors-in-frontend-php-causing-405-server-errors/)
 * I’m experiencing an issue with GTM4WP that’s causing my hosting provider (WPEngine)
   to serve 405 error pages instead of the WordPress login page when your plugin
   is active.
 * **The Root Cause:** WPEngine’s server logs show PHP fatal errors in your plugin’s
   frontend.php file:
    1. **Line 636:** Undefined array key “http_user_agent”
    2. **Line 639:** Undefined variable $page
    3. **Additional error:** Trying to access array offset on value of type bool
 * **File:** /wp-content/plugins/duracelltomi-google-tag-manager/public/frontend.
   php
 * **Environment:**
    - WordPress: 6.7.2
    - GTM4WP Version: 11.16.1 
    - Hosting: WPEngine
    - PHP Version: 8.2
 * **Impact:** These PHP errors cause the server to return 405 responses.
 * **Steps to Reproduce:**
    1. Activate GTM4WP on PHP 8.2
    2. Visit wp-login.php
    3. Server logs show the fatal errors above
 * The errors disappear when the plugin is deactivated.
 * Thanks for the great plugin. Hoping for a fix in the next update!

The topic ‘PHP Fatal Errors in frontend.php Causing 405 Server Errors’ is closed
to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

## Tags

 * [405 error](https://wordpress.org/support/topic-tag/405-error/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)

 * 0 replies
 * 1 participant
 * Last reply from: [rodono419](https://wordpress.org/support/users/rodono419/)
 * Last activity: [8 months, 1 week ago](https://wordpress.org/support/topic/php-fatal-errors-in-frontend-php-causing-405-server-errors/)
 * Status: not resolved