Htaccess error
-
Hi there!
I just installed the plugin on our site and am really happy, but have noticed a large number of errors logged as below:
PHP Warning: fopen(/nas/content/live/chalkboardroom/.htaccess): Failed to open stream: Permission denied in /nas/content/live/chalkboardroom/wp-admin/includes/misc.php on line 175
These stop when I disable this plugin, and start again when I reactivate. I spoke to our host (WPEngine), who said they don’t use htaccess files anymore, so maybe thats the issue (the relevant piece of code is ‘$fp = fopen( $filename, ‘r+’ );;).
We’re on WordPress 6.6.1, if that helps.
Would be very grateful if anyone has any ideas what might be the issue here?
Best wishes
Mike
-
Hi @mikeowl321, this is surprising to see. This issue appears to be related to “chalkboardroom” not our plugin. Would you please double-check?
I can confirm it: the activation of this complement has as a collateral effect the update (access, opening in writing mode, closing) of the file /.htaccess, in each visit to the website, causing a decrease in performance.
[19/ago/2024 11:17:53] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:17:53] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:17:54] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:17:54] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:17:55] IN_MODIFY /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:17:55] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:17:55] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:18:16] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:18:16] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:18:25] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:18:25] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:18:58] IN_MODIFY /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:18:58] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:18:58] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:18:58] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:18:58] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:20:42] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:20:42] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:20:42] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:20:42] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:23:26] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:23:26] * /var/home/fluircentro.es/www/.htaccess is closed
[19/ago/2024 11:23:26] IN_CLOSE_WRITE /var/home/fluircentro.es/www/.htaccess
[19/ago/2024 11:23:26] * /var/home/fluircentro.es/www/.htaccess is closedThe way to mitigate low performance is to remove writing permissions to .htaccess file. There is no bugs in the error.log file in doing so. Obviously, it is not the ideal solution because WordPress requires that said file to have writing permits.
It is very curious. Sometimes the .htaccess file is rewritten in English, and other times in the language of the website.
# BEGIN WordPress
# Las directivas (líneas) entre «BEGIN WordPress» y «END WordPress» son
# generadas dinámicamente y solo deberían ser modificadas mediante filtros de WordPress.
# Cualquier cambio en las directivas que hay entre esos marcadores serán sobrescritas.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressNo rewriting rules are written in the file, at least apparently we have seen. Only the previous text is shown.
These are the variables defined in the WordPress Options Table:
sm_beta_banner_discarded_count
sm_beta_banner_discarded_on
sm_cpages
sm_hide_auto_update_banner
sm_options
sm_rewrite_done
sm_show_beta_banner
sm_status
sm_user_consent-
This reply was modified 6 months, 3 weeks ago by
joaquinferrero.
The sitemap.xml file is not generated.
Plugin version 4.1.21. PHP v7.4.30. WordPress 6.6.1-
This reply was modified 6 months, 3 weeks ago by
joaquinferrero.
There appears to be a conflict with rewrites that may cause this issue. To confirm, when the plugin is disabled the .htaccess errors stop?
Confirmed. Writing to .htaccess stopped.
Plugins installed:
+---------------------------------+----------+-----------+---------+
| name | status | update | version |
+---------------------------------+----------+-----------+---------+
| easy-paypal-donation | active | none | 1.4.2 |
| tinymce-advanced | active | none | 5.9.2 |
| call-now-button | active | none | 1.4.10 |
| classic-editor | active | none | 1.6.4 |
| cmp-coming-soon-maintenance | active | none | 4.1.13 |
| contact-form-7 | active | none | 5.9.8 |
| contact-form-7-simple-recaptcha | active | none | 0.1.6 |
| woo-coupon-usage | active | none | 5.15.0 |
| duplicate-page | active | none | 4.5.4 |
| elementor | active | available | 3.17.0 |
| gdpr-cookie-compliance | active | none | 4.15.2 |
| jetpack | active | none | 13.7 |
| creame-whatsapp-me | active | none | 5.1.7 |
| liquid-custom-builder | active | none | 1.4.0 |
| liquid-import-export | inactive | none | 1.1.0 |
| loco-translate | active | none | 2.6.11 |
| mce-table-buttons | active | none | 3.3 |
| object-cache-4-everyone | active | none | 2.2 |
| wp-user-avatar | active | none | 4.15.12 |
| really-simple-captcha | active | none | 2.3 |
| redux-framework | active | none | 4.4.18 |
| google-site-kit | active | none | 1.133.0 |
| revslider | active | none | 6.6.15 |
| updraftplus | active | none | 1.24.4 |
| woocommerce | active | none | 9.1.4 |
| woocommerce-paypal-payments | active | none | 2.8.3 |
| woo-redsys-gateway-light | active | none | 6.1.2 |
| wp-sitemap-page | active | none | 1.9.4 |
| google-sitemap-generator | inactive | none | 4.1.21 |
| wordpress-seo | active | available | 23.2 |
| 1and1-subdomain | must-use | none | 1.1.0 |
| object-cache.php | dropin | none | |
+---------------------------------+----------+-----------+---------+Themes installed:
+-----------------+----------+--------+---------+
| name | status | update | version |
+-----------------+----------+--------+---------+
| medcaline | active | none | 1.0.0 |
| twentytwentytwo | inactive | none | 1.8 |
+-----------------+----------+--------+---------+Hey guys, to confirm I can replicate the above (when I uninstall the plugin the issue stops).
Hi there, any update on this one? I’m still seeing this issue. I’m going to have to switch plugins if I can’t find an answer to this one… To confirm, the issue stops when I deactivate the plugin, and starts again when I reactivate
Thanks for your patience. Would you be interested in trying the next release that is available on GitHub? This version only uses rewrites for a subset of use cases.
Hi there
Apologies for missing this. Is this the same release as the last update (4.1.21)? If so then unfortunately this did not resolve the issue.
Kind regards
Hi there, please can you provide an update on this issue? It has been quite a while now and this issue still is not resolved
If it helps, I’ve spoken to our web host and they say that this can be resolved with an nginx rule, but that this would need to come from you. Does that make sense?
All fine with WordPress v6.7.1 and google-sitemap-generator v4.1.21
Thanks!Ah, this is happening with Nginx @mikeowl321? @joaquinferrero said this is resolved.
Ok, great!
Hey guys, glad its working for you but unfortunately I am still seeing this issue. To explain again, this is happening because my webhost doesn’t use an htaccess file. The error is as below:
PHP Warning: fopen(/nas/content/live/INSTALLNAME/.htaccess): Failed to open stream: Permission denied in /nas/content/live/chalkboardroom/wp-admin/includes/misc.php on line 175
This doesn’t affect site operation at all, but does effectively render the debug.log file to be useless.
Actions I have taken to test this, which leads me to think that this issue is definitely with your plugin:
- Deactivated google-sitemap-generator plugin on live site, and errors stop
- Reactivated google-sitemap-generator on live site, and errors start again
- Run through all other theme and plugins activation / deactivation, with no effect on the errors
Please can you review? I am on WordPress 6.7.1 and google-sitemap-generator v4.1.21. According to my webhost this is an issue with the plugin as well. I can’t be the only person this is effecting; many web hosts don’t use htaccess files anymore. Please help!
-
This reply was modified 6 months, 3 weeks ago by
- You must be logged in to reply to this topic.