• 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

    (@duracelltomi)

    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

    (@dominikshaim)

    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

    So, it is incorrect information?

    Thank you.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    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

    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

    (@dominikshaim)

    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.