Title: PHP 7.x &#8211; PHP Fatal error: Cannot redeclare getallheaders()
Last modified: May 21, 2020

---

# PHP 7.x – PHP Fatal error: Cannot redeclare getallheaders()

 *  [dominikshaim](https://wordpress.org/support/users/dominikshaim/)
 * (@dominikshaim)
 * [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/)
 * Hello,
 * if we use PHP 5.6, all is working well. If we use PHP 7.X, we got this Fatal 
   error:
 * PHP Fatal error: Cannot redeclare getallheaders() in /html/www/wp-content/plugins/
   duracelltomi-google-tag-manager/public/frontend.php on line 119
 * Version latest now (1.11.4)
 * Thank you.

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

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/#post-12873579)
 * Hi,
 * This is usually happening if the PHP configuration on your hosting has disabled
   the PHP function getallheaders(). There is an odd flow inside PHP which reports
   to a script that a disabled function is non-existing however it still can not
   be recreated.
 * So in this case, GTM4WP sees that the server configuration is missing an important
   function but it is there “just” disabled.
 * I am of course open to change this behavior somehow but first it would be great
   to understand the reasons behind disabling this functions. Without that, I might
   create an alternative code that will not function either. Could you please contact
   your hosting company and ask why this function is disabled in your case?
 * GTM4WP is running on lots of PHP 7.x sites, gtm4wp.com is running on PHP 7.3 
   without issues but this function is not disabled.
 *  Thread Starter [dominikshaim](https://wordpress.org/support/users/dominikshaim/)
 * (@dominikshaim)
 * [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/#post-12874560)
 * Hi,
 * thank you for prompt reply. Because this function (getallheaders) is listed on
   websites about php security, for example:
    [https://www.vennedey.net/resources/3-Secure-webspaces-with-NGINX-PHP-FPM-chroots-and-Lets-Encrypt](https://www.vennedey.net/resources/3-Secure-webspaces-with-NGINX-PHP-FPM-chroots-and-Lets-Encrypt)
 * So, it is incorrect information?
 * Thank you.
 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/#post-12891918)
 * I do not think I am the one who will override such security whitepapers 🙂
 * Tough I do my best to be on the top with the latest security considerations with
   PHP, I haven’t found any specific details around `getallheaders()`.
 * For example, this one shows that getallheaders() has been added to PHP-FPM in
   2018
    [https://bugs.php.net/bug.php?id=62596](https://bugs.php.net/bug.php?id=62596)
 * Your mentioned document only lists this function in the disabled_functions PHP
   option but I do not see the reasons. I will try to find some open documentation
   about getallheaders() having any security implications.
 * In the meantime, you can disable the browser/os/device feature in GTM4WP or allow
   this function in your PHP config.
 *  Thread Starter [dominikshaim](https://wordpress.org/support/users/dominikshaim/)
 * (@dominikshaim)
 * [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/#post-12892221)
 * OK, well, thank you for solution. 🙂

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

The topic ‘PHP 7.x – PHP Fatal error: Cannot redeclare getallheaders()’ 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

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 4 replies
 * 2 participants
 * Last reply from: [dominikshaim](https://wordpress.org/support/users/dominikshaim/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/php-7-x-php-fatal-error-cannot-redeclare-getallheaders/#post-12892221)
 * Status: not resolved