WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. digitalsky
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. indietravel
    Member
    Posted 1 year ago #

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

  3. digitalsky
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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.
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, this is fixed in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic