• Resolved Llewen

    (@llewen)


    I received this error every time I tried to change the setting “Protect admin scripts”. mod_rewrite absolutely is enabled on my lamp stack.

    I think the problem lies in “cerber-common.php”, line 2,893:

    if ( ! apache_mod_loaded( 'mod_rewrite', true ) ) {

    I don’t know whether this is a WordPress issue or a Cerber issue.

    • This topic was modified 3 years ago by Llewen.
    • This topic was modified 3 years ago by Llewen.
    • This topic was modified 3 years ago by Llewen.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter Llewen

    (@llewen)

    edit: Fix didn’t work.

    • This reply was modified 3 years ago by Llewen.
    Plugin Author gioni

    (@gioni)

    You can check the loaded modules by creating a temporary test PHP file with phpinfo() in the root folder and opening it in a browser. See more: https://www.php.net/manual/en/function.phpinfo.php

    Do not forget to remove the file after tests.

    Thread Starter Llewen

    (@llewen)

    I’ve double, triple, quadruple, quintuple, sextuple, checked, rechecked, gone back months later and done it all again. mod_rewrite is absolutely enabled. It’s in my /etc/apache2/mods-available, the symlink is in /etc/apache2/mods-enabled. .htaccess contains the following code:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    /usr/lib/apache2/modules contains mod_rewrite.so, so that’s there as well. phpinfo ( ) also lists it, as follows.

    Loaded Modules core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_filter mod_headers mod_mime prefork mod_negotiation mod_php7 mod_reqtimeout mod_rewrite etc.

    I’ve also tried AllowOverride All, just to be sure that wasn’t the issue. It made no difference.

    Plugin Author gioni

    (@gioni)

    What version of PHP do you run? Does apache_mod_loaded() always return the same result for any other Apache module installed on the server, including a random string?

    Thread Starter Llewen

    (@llewen)

    Here’s a link to the phpinfo ( ) as a pdf. I tried to remove all the possible dox data, but I can’t be sure I got it all. I’ll delete the file and remove the link when I know you have it.

    phpinfo

    Thread Starter Llewen

    (@llewen)

    The “Microsoft IIS 5.0” is my little joke on hackers attempting to hack the website…

    Thread Starter Llewen

    (@llewen)

    On the off chance that you think Mod Security is the issue, I have attempted to disable it, to no effect.

    Thread Starter Llewen

    (@llewen)

    Just to be double sure, I disabled modsecurity entirely, and encountered the same error.

    Thread Starter Llewen

    (@llewen)

    I’m not really good with WordPress or with PHP, so this was a bit of fun, but as far as I can see, unless I am running into permissions issues, apache_mod_loaded always returns FALSE.

    I ran this code on various bits of the admin page, using different mod names and just a random string, and it always returned FALSE. But perhaps I was just plugging it into the wrong place. I’m a hack when it comes to scripting. I’m not really skilled.

    <div>
    <?php
    if ( apache_mod_loaded( 'mod_rewrite' ) ) {
        echo "TRUE";
    } else {
        echo "FALSE";
    }
    ?>
    </div>
    Thread Starter Llewen

    (@llewen)

    I double checked the documentation. That function doesn’t appear have any specific scope, so it should run on any page, and it returned false no matter what page I ran it on, no matter what data I fed it.

    Thread Starter Llewen

    (@llewen)

    I think I figured it out. My little joke backfired on me. Changing the server string messed up the contents of the “$is_apache” variable. That might well be why a bunch of other things that I’ve never been able to figure out are broken in my WordPress. I’ll post back when I know for sure.

    Thread Starter Llewen

    (@llewen)

    Ya, that was it. Thanks for your help. I’m not sure why disabling modsecurity didn’t also disable that, but it didn’t. That was also the reason for a lot of the other issues I’ve been having with WordPress. Lesson learned.

    Plugin Author gioni

    (@gioni)

    Good news!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Error: The Apache mod_rewrite module is not enabled…’ is closed to new replies.