Warning: fopen(/.htaccess) [function.fopen] … fwrite() … fclose()
-
Seeing a BPS warning like this is completely new to me, and the Googling I did seems to suggest is comes from some kind of permissions error. Here is what I am seeing at the top of BPS at just one of eight sites:
Warning: fopen(/.htaccess) [function.fopen]: failed to open stream: Permission denied in .../wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 140 Warning: fwrite() expects parameter 1 to be resource, boolean given in .../wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 141 Warning: fclose() expects parameter 1 to be resource, boolean given in .../wp-content/plugins/bulletproof-security/admin/db-backup-security/db-backup-security.php on line 142Since I have never done anything with any of those folders, I thought it best to come ask you about this before I go poking around…
Excellent plugin with above-and-beyond support!
-
PS: BPS DB Backup at that same site is not displaying a DB Backup Folder Location or DB Backup File Download Link/URL even though it does have a /bps-backup/backups_… folder where it should, and I would add that my additional db backups folder even inside the /bps-backup/backups_…/ folder has been working fine (but now I am switching to BPS DB Backup).
One more thing on the initial question here about the warnings:
I just tried to run BPS through its one-click series of buttons at the troubled site and got this after clicking to Activate BPS Backup BulletProof Mode:
Failed to Activate BulletProof Security Deny All Folder Protection! Your BPS /wp-content/bps-backup folder is NOT Protected with Deny All htaccess folder protection!Good clues. All the clues point to either a folder permission problem with the /bps-backup/ folder or an Ownership issue/problem with the /bps-backup/ folder if this is a DSO server type.
Go to the Security Status tab page and post your folder permissions for the /wp-content/bps-backup/ folder.
Similar/same issue/problem:
https://ww.wp.xz.cn/support/topic/getting-php-warning-error?replies=4Logic suggests this is not a server problem since the troubled site is at Arvixe along with four others having no troubles. The only thing different about it is that it is the primary Domain in a sub-folder. If you wish, I could easily remove BPS and its tables and then re-install to see whether that fixes things.
I have occasionally had to argue a bit with BlueHost Support Techs about these “Stay-out-of-my-garage!” settings, then I tell them to do as they please and I will just put them back later:
.htaccess 0404 wp-config.php 0400 index.php 0400 wp-blog-header.php 0400 root folder 0705 wp-admin/ 0705 wp-includes/ 0705 wp-content/ 0705 wp-content/bps-backup/ 0755Yeah i guess give that a try. the error means either the folder does not exist or is not writable. after that I can’t think of any other reason for the unable to write to folder” errors.
I will mark this resolved for now and see what happens on the morrow…
Many thanks!
You should use FTP and check that the Owner of the /bps-backup/ folder is the same Owner for your other folders. All of your website folders should have the same Owner.
This is the first I have heard of an Owner’s ID being anything other than “Owner”, but I will definitely learn about that and check before doing anything more. I did have a couple of foopaws during the initial WordPress installation (while learning more about wp-config) and then deleted a database to start over, but maybe there was some residual damage done there.
It is very rare but I have seen that problem on CGI server types a few times. I believe it can be caused by using SSH under another user which then changes the Ownership of the folder/file.
I have seen that problem on CGI server types a few times. I believe it can be caused by using SSH under another user which then changes the Ownership of the folder/file.
While here to let you know everything is fine following a fresh BPS installation, I just now realized I might have caused the problem while fumbling around a bit while installing phpMyAdmin on my domain.
http://kb.siteground.com/how_to_access_phpmyadmin_directly_from_my_domain/In any case, I had an Arvixe Support Tech do a chmod 0755 / 0644 on my account, and then I went back in and made the suggested BPS changes…and now the problem is gone. But however this incident had happened, you were right once again.
You already know this, of course, but your BPS DB Backup is a great tool! I had read your announcement when it was first added, but I had lots of other stuff going on at that time and I had only taken a quick look. I now have it set on all sites, and I know BPS can be trusted to do what it is supposed to do and to do things well.
If this might be possible, maybe consider adding some kind of link within BPS DB Backup for a popup to the WP Clean Up https://ww.wp.xz.cn/plugins/wp-clean-up/ plugin, where installed. That plugin does a great job of cleaning and optimizing, and I always use it before doing manual backups. The database backup plugin I had used in the past has its own cleaner/optimizer, but I had done some testing and WP Clean Up does even more cleaning after the other one had finished.
While setting up BPS DB Backup for the first time on eight sites sitting side-by-side in my browser, new backup jobs did not get saved until I had learned to first check, uncheck and then recheck “All” at DB Table Name. So, maybe some kind of refresh could be added there.
If I may, I would suggest these re-arrangements of BPS SD Backup Job options:
Backup Job Type: Manual or Scheduled Scheduled DB Backup Job Manual DB Backup Job Frequency of Scheduled Backup Job (recurring) Monthly DB Backup Job Weekly DB Backup Job Daily DB Backup Job N/A Day of Month When Scheduled Backup is Run (recurring) (as is) Day of Week When Scheduled Backup is Run (recurring) (as is) Hour When Scheduled Backup is Run (recurring) (as is)As those are right now, it took me a while while to get past the broken flow of intuitive logic when encountering Day-of-Week while looking for Day-of-Month to set up a Monthly Scheduled DB Backup Job.
And finally, it would be great to have the option to uncheck “Zip” when doing backups that will not be e-mailed. Having to un-Zip a database backup to do a restoration from an SFTP-dowloaded file makes for more work, and it also doubles the number of files I store locally…
…and many thanks for considering my unsolicited opinions!
Great plugin.
Interesting idea about adding a link to WP Clean Up. We will look into that some more.
You should not have to uncheck and recheck DB Tables. All DB Tables are already checked by default. The checkboxes are just checkboxes – they are either checked or unchecked – no other magic is occurring. I guess test things like deactivating all other plugins and switching your theme to see if another plugin or theme is interfering with the DB table form???
I have put your DB Backup ideas on the Review Task list. We will review your DB Backup ideas in more depth when we get back there. We usually do things in this priority: optimum functionality first and then circle back around and do additional visual stuff and other lower priority things. At some point we may even do some bells and whistles, but B&W has the lowest priority since it is the least important thing overall. π
You should not have to uncheck and recheck DB Tables. All DB Tables are already checked by default. The checkboxes are just checkboxes – they are either checked or unchecked – no other magic is occurring.
Understood, and I think the issue there might have actually only been my need to refresh such as in order for the Security Status display to update after having used the “Lock htaccess File” in the htaccess File Editor. I think I was wrong in saying the Backup Jobs had not been made as I had first reported. In any case, I have things all set there now and I am looking forward to not having to remember to go look to see whether my backups have even been made at all.
At some point we may even do some bells and whistles…
If you might ever make BPS whistle this…
http://www.youtube.com/watch?v=Ra4HWj1jrJA&playnext=1&list=PLD05AB5B74E062F25
…I would be up out of my seat dancing and never get any work done!
Many thanks.
We usually do things in this priority: optimum functionality first and then circle back around and do additional visual stuff and other lower priority things.
Maybe somewhere in the middle of that, possibly give some thought to adding “Edit” to DB Backup Jobs. While making around two dozen Jobs over eight sites, I occasionally had to delete one and do it again because I was not certain of what I had just done!
Editing DB Backup Jobs was not added intentionally, but I have added it to the Review Task list. The reason states: completely unnecessary/non-useful.
One of your ideas was approved already: create a dump in sql format. Usually that means it would be in either the BPS version after the next one or the next one after that. BPS .51.2 is locked. Meaning nothing else will be added to that version.
The topic ‘Warning: fopen(/.htaccess) [function.fopen] … fwrite() … fclose()’ is closed to new replies.