• Resolved pklinaf

    (@pklinaf)


    Hello, I am trying to setup the plugin, so I am following the instructions: I enter the email address and api key, press the button and then on the next screen as soon as I select the domain and press the button I get a 500 error.
    Noting that I’m already using the plugin successfully in other sites on the same server.
    Please help.

    If I disable the plugin’s .htaccess rules I don’t get a 500 error anymore anymore.

    • This topic was modified 3 years, 2 months ago by pklinaf.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @pklinaf,
    Honestly, the chances of this plugin creating 500 error are very thin as we test the plugin across multiple different servers before releasing it. But the good news is that it is a 500 error which means there should be server error log showing exactly which file from what line of code is throwing the 500 error to easily track it. Talk to your host to check the error log file.

    I personally think some other plugin might be creating a conflict and is the reason behind the error 500. But the server error log only has the answer of what’s causing it.

    Thread Starter pklinaf

    (@pklinaf)

    Hi Saumya thank you for your response. Ok I looked at the log and here’s what I found relating to the plugin:

    Invalid command ‘<If’, perhaps misspelled or defined by a module not included in the server configuration, referer: https://[mydomain]/wp-admin/options-general.php?page=wp-cloudflare-super-page-cache-index

    I replaced the referer domain in the above message with [mydomain]

    Thread Starter pklinaf

    (@pklinaf)

    Noting I am using an old php v7.0.33 do you think it’s because of this ?

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @pklinaf,
    Is that the error log or access log? Cause as t is error 500 it should give a fatal error to generate that. Also there generally is a line number and file name showing where it is coming from in the log.

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @pklinaf ,
    are you using an Apache version older then 2.3?

    Thread Starter pklinaf

    (@pklinaf)

    @salvatorefresta probably yes, I just found out that if expressions are supported since apache 2.4 so we may have found the cause of the error.

    Is there a way around this for older apache servers? Meaning, do you have a fallback solution?

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @pklinaf,
    You can try changing the following code in .htaccess file:

    Change:

    <IfModule mod_headers.c>
        <If "%{THE_REQUEST} =~ m#\s/+wp-json/?[?\s]#">
        Header set Cache-Control "max-age=0, public"
        </If>
    </IfModule>
    

    To:

    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType application/json "access plus 0 seconds"
    </IfModule>
    

    And see if it works. Let me know.

    Thread Starter pklinaf

    (@pklinaf)

    Hi @isaumya, that actually worked. However that if stmt gets rewritten to .htaccess everytime settings are changed.
    Any plans to support apache < v.2.4 ?

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @pklinaf,
    You can just edit the .htaccess and comment out that line. Apache 2.4 was released in 2012. We are now standing in 2021, 9 years from the release. I think it is high time that the users should force their hosts to upgrade to Apache 2.4.

    What you are asking for we will check internally if something like that will be possible.

    Thread Starter pklinaf

    (@pklinaf)

    Thank you @isaumya. You’re absolutely right about this. Again, thank you for your time.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘500 Internal Server Error after entering cloudflare api key’ is closed to new replies.