gregmurf
Forum Replies Created
-
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…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")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.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 ) {Hi 🙂
i added the code at the en of the better-wp-security/core/lib/class-itsec-lib-file.php file.ok 🙂
Much better. Now:
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.
WP run with www-data, and WP directory is already “chowned” with chown www-data:www-data -R *More info:
Deprecated: Non-static method WP_Error::get_error_message() should not be called statically in /var/www/html/wordpress/wp-admin/itsec-write-test.php on line 16 Fatal error: Uncaught Error: Using $this when not in object context in /var/www/html/wordpress/wp-includes/class-wp-error.php:137 Stack trace: #0 /var/www/html/wordpress/wp-admin/itsec-write-test.php(16): WP_Error::get_error_message() #1 {main} thrown in /var/www/html/wordpress/wp-includes/class-wp-error.php on line 137That’s the problem: i receive everything (plugin disable, login access, etc…), but this error does not send anything..
Thanks for your help !- This reply was modified 5 years, 5 months ago by gregmurf.
1.9k
I’ve delete itsec-write-test.php from wp-admin
Then create a new one and paste the code.
Then run the URL
==> File writing succeeded.Edit the script and just replace test1.txt by .htaccess
==> WP errorSame error.
itsec-write-test.php content:<?php /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; /** Only users with manage options capability allowed */ if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage options on this site.' ) ); } /** Write to a new test file */ /**$result = ITSEC_Lib_File::write( '/var/www/html/wordpress/.htaccess', "This is a .htaccess test.\n" );*/ $result = ITSEC_Lib_File::write( '/var/www/html/wordpress/.htaccess', "This is a test.\n" ); /** Check and show the result */ if ( is_wp_error( $result ) ) { echo 'Error msg: ' . $result::get_error_message(); } else { echo 'File writing ' . ( $result?'succeeded.':'failed.' ); }- This reply was modified 5 years, 5 months ago by gregmurf.
Done: change the itsec-write-test.php to
/** Write to a new test file */ $result = ITSEC_Lib_File::write( '/var/www/html/wordpress/.htaccess', "This is a .htaccess test.\n" );And i have this error:
une erreur critique est survenue sur votre site. Veuillez consulter la boite de réception de l’e-mail d’administration de votre site pour plus d’informations. En apprendre plus sur le débogage de WordPress..htaccess is not modified and WP is up.
I use Wordfence. It’s not a problem ?
i delete test1.txt. But i dont understand how to perform the “second write test” ?
Do you mean this: “Then change the test script (itsec-write-test.php) and simply change the filename “test1.txt” into “.htaccess”
Now run the test script again.” ?- This reply was modified 5 years, 5 months ago by gregmurf.