• I am running WordPress multisite with Wordfence on an Apache webserver. The WordPress multisite is installed at the DOCUMENT ROOT of the website and is configured so that all of the WordPress code (other than the main index.php and .htaccess files) are in a sub-folder (called wp/).

    I also have other PHP web pages / apps on this same website as sub-folders and I have my rewrite rules setup so that they live happily alongside WordPress on the same website.

    Prior to upgrading to PHP 7, I used a RewriteRule like this

    # Prevent WordFence prepending it's PHP to anything other than WordPress
    <If "%{REQUEST_URI} !~ m#^(/wp/|/index.php)#">
        php_value auto_prepend_file none
    </If>

    in my main .htaccess file to prevent Wordfence being bootstrapped for my non-WordPress PHP pages / apps. However, now that I’m running PHP 7, php_value has to be set in .user.ini and as far as I can tell, there is no way to do this via .user.ini.

    Can I just move

    /DOCUMENT_ROOT/.user.ini

    to

    /DOCUMENT_ROOT/wp/.user.ini

    Otherwise, the only other way I can think of doing this is to put a .user.ini in each sub-folder with the php_value auto_prepend_file none line in it, but that’s not a good solution as it’s a lot of duplication of configuration and this requires me (and others I work with) to remember to create this .user.ini file if we ever create a new sub-folder at the DOCUMENT_ROOT level.

    So, can I move the .user.ini file as specified above. Or is there some other solution?

    Thanks! ??

  • The topic ‘Move .user.ini to sub-folder’ is closed to new replies.