• 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 5 years, 5 months ago by gregmurf.
    • This topic was modified 5 years, 5 months ago by gregmurf.
Viewing 7 replies - 31 through 37 (of 37 total)
  • Thread Starter gregmurf

    (@gregmurf)

    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 5 years, 5 months ago by nlpro.
    • This reply was modified 5 years, 5 months ago by nlpro.
    Thread Starter gregmurf

    (@gregmurf)

    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.
    Thread Starter gregmurf

    (@gregmurf)

    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 5 years, 5 months ago by nlpro.
    • This reply was modified 5 years, 5 months ago by nlpro.
    • This reply was modified 5 years, 5 months ago by nlpro.
    Thread Starter gregmurf

    (@gregmurf)

    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 5 years, 5 months ago by nlpro.
Viewing 7 replies - 31 through 37 (of 37 total)

The topic ‘Cannot write .htaccess’ is closed to new replies.