W3 Total Cache
Problem with New Relic and .htaccess file (7 posts)

  1. digitalsky
    Posted 3 years ago #

    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... https://newrelic.com/docs/php/per-directory-settings

    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.


  2. indietravel
    Posted 3 years ago #

    Same issue here: using multisite, but it's an .htaccess issue when we activate new relic through the w3tc front-end.

  3. digitalsky
    Posted 3 years ago #

    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.

  4. MediaInk
    Posted 3 years ago #

    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.

  5. Frederick Townes
    Plugin Author

    Posted 3 years ago #

    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.

  6. Josh S.
    Posted 3 years ago #

    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.

  7. Frederick Townes
    Plugin Author

    Posted 3 years ago #

    Ok, this is fixed in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic