Support » Plugin: W3 Total Cache » Problem with New Relic and .htaccess file

  • I’m using New Relic in conjunction with W3 Total Cache on a WordPress site of mine. I’ve got my own dedicated server as well which the site resides on.

    New Relic seems to be working fine, however, when I try to integrate it with W3 Total Cache it causes a 501 bad gateway error to appear when trying to access the site in any web browser.

    I’ve narrowed the problem down to the .htaccess file. W3 Total Cache is inserting this code in my .htaccess file whenever New Relic is enabled…

    php_value newrelic.appname ‘PR Tech’

    That code is what is causing the 501 bad gateway errors all throughout my site. When I remove that code and disable New Relic via W3 Total Cache everything works just as it should.

    I’ve read the New Relic documentation here…

    That article states that the code that W3 Total Cache is inserting in the .htaccess file is indeed correct. So, I’m not sure what’s going on here and was hoping maybe someone had some sort of idea.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Same issue here: using multisite, but it’s an .htaccess issue when we activate new relic through the w3tc front-end.

    Good to know I am not the only one. Maybe Frederick will chime in! I’ve spoken to New Relic directly about it but they are no help.

    The integration with new relic is not without problem for us either.

    1. It does work with one site (even network is enabled in WP but has only the main site created)
    2. Does not work with if we have multiple child sites with network enabled
    3. Does work with condition 2 but page cache debug enabled
    4. Does work with condition 2 but with manual instrumentation (W3 code insertion is bypassed)

    P.S. We have ” Use single network configuration file for all sites” and “Hide performance settings” disabled.

    Plugin Author Frederick Townes


    For single installs. Have you tried enabling Use PHP function on the Monitoring page? Its meant to be used for servers that don’t support the php_value settings such as php-fpm and nginx etc.

    @mediaink: I don’t know of issue with multisite but will look into it. If you can send a bug report from the support tab of the plugin then we can help investigate issue on your site?

    The next version will only support the php function way and not set value using htaccess so to give better control over the setting of application name using the various methods New Relic support.

    Same issue here, I think. As soon as I properly enable New Relic, 500 Server Error across the site. Must manually remove the inserted .htaccess line, uncheck the “Enable” New Relic, and Save. Then all is well with the site again.

    This is not MU site.

    Plugin Author Frederick Townes


    Ok, this is fixed in the next release.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem with New Relic and .htaccess file’ is closed to new replies.