Support » Plugin: iThemes Security (formerly Better WP Security) » Cannot write .htaccess

  • Hi,
    i try to make some changes on iThemes Security but it says “.htaccess cannot be written”.
    “Allow iThemes Security to write on wp-config.php et .htaccess” is checked.
    .htaccess rights are 644.
    Any idea ?

    thanks 🙂

    • This topic was modified 1 month, 3 weeks ago by gregmurf.
    • This topic was modified 1 month, 3 weeks ago by gregmurf.
Viewing 7 replies - 31 through 37 (of 37 total)
  • Like this ?

    		$file_existed = self::is_file( $file );
    		$success = false;
    
    		// Different permissions to try in case the starting set of permissions are prohibiting write.
    		$trial_perms = array(
    			false,
    			0644,
    			0664,
    			0666,
    		);
    
    echo '<pre>';         //New line
    print_r( $callable ); //New line
    echo '</pre>';        //New line
    
    		foreach ( $trial_perms as $perms ) {
    

    Yes, that is correct. I’ve decided to change our debugging strategy. Let’s run the itsec-write-test.php script now. Update the topic with the output.

    Remember you can only run the itsec-write-test.php script from a second tab after logging into WordPress Dashboard from the first tab of the browser.

    We need the WordPress authentication cookie to exist in the browser in order to be able to run the itsec-write-test.php script. Just a bit of background info 😉

    Oh, almost forgot. Is there currently anything related to the iThemes Security plugin in the .htaccess file ? (I guess not).

    iThemes entries in the .htaccess file will be between 3 lines as seen below:

    # BEGIN iThemes Security – Do not modify or remove this line
    # iThemes Security Config Details: 2

    # END iThemes Security – Do not modify or remove this line

    Note these lines could be translated in the local language.

    • This reply was modified 1 month, 3 weeks ago by nlpro.
    • This reply was modified 1 month, 3 weeks ago by nlpro.
    Array
    (
        [0] => fopen
        [1] => file_put_contents
    )
    Error msg: /var/www/html/wordpress/.htaccess n’a pas pu ĂȘtre Ă©crit. C’est peut ĂȘtre dĂ» Ă  un problĂšme de permissions. Assurez-vous que PHP est lancĂ© avec les permissions utilisateurs nĂ©cessaires pour Ă©crire Ă  cet emplacement.

    Well, after setting good folder permissions with
    chown -R www-data:www-data /var/www
    .htaccess has been overwrited.
    But now when i set “use HackRepair.com”, i have this error:

    Une erreur de l’analyseur a empĂȘchĂ© la requĂȘte d’aboutir comme prĂ©vu. Le site a envoyĂ© une rĂ©ponse que jQuery n’a pas pu traiter. Cela pourrait ĂȘtre dĂ» Ă  un conflit de thĂšme / d’extension ou Ă  un problĂšme de configuration serveur. (itsec-settings-page-ajax-error-parsererror: parsererror "SyntaxError: Unexpected token < in JSON at position 0")

    Ok, great. It looks like you solved the issue! So now you need to restore the backup copy of the better-wp-security/core/lib/class-itsec-lib-file.php file.

    That should solve the new error.

    • This reply was modified 1 month, 3 weeks ago by nlpro.
    • This reply was modified 1 month, 3 weeks ago by nlpro.
    • This reply was modified 1 month, 3 weeks ago by nlpro.

    done. But strange thing: i check “use HackRepair.com” and i can see the list on .htaccess.
    But when i try to add an IP on the “Blocked list”, i can validate, but the ip isn’t shown on the .htaccess…

    According to the iTSec plugin 7.8.0 Changelog:

    Enhancement: Remove quick bans. Persist banned hosts to .htaccess or nginx.conf on an hourly schedule.

    The plugin uses WP cron to write the IPs to the .htaccess file. The cron task is named flush-files and runs hourly.

    • This reply was modified 1 month, 3 weeks ago by nlpro.
Viewing 7 replies - 31 through 37 (of 37 total)
  • You must be logged in to reply to this topic.