This project is read-only.

BlogEngine 2.5, can't enable extensions on GoDaddy

Topics: Business Logic Layer, Controls
Aug 30, 2011 at 4:16 AM

When I try to enable or disable an extension (like Akismet), I get an error that says "access to web.config is denied".  After calling GoDaddy support, they say there's nothing they can do, as permissions of files in the root cannot be set.  

So is there any code workaround for this?  


Aug 30, 2011 at 12:31 PM

The code in there now tries updating the Last Modified Date of the web.config file.

You could change it to instead modify the Last Modified Date of a file in the BIN directory (e.g. BlogEngine.Core.dll) or the App_Code directory.  This should produce the same effect of restarting the application.

Aug 30, 2011 at 1:00 PM

Ben's approach should work great. 

Additionally, it may be worth knowing that in such a situation where the site can't modify the web.config modified date, it's still updating the info that lets itself know that you want the extension enabled or disabled.  What modifying the web.config mod date does is cause the site to restart and thus give the extensions a chance to reload in the newly configured state. 

So an alternative is simply to use the hosting company's control panel to cause the site to restart. (I'm assuming godaddy provides this feature as most hosting companies do).


Aug 30, 2011 at 5:39 PM

When you say "the code in there" do you mean the code in the Akismet extension file, or code somewhere in the BlogEngine core?  

I don't think it's saving the extension values or updating the enabled state though.  Because after the application is restarted, the extension is disabled again and the extension settings are lost.  I verified this by looking at the raw xml in the be_DataStoreSettings table in the database, and after an application reboot the extension gets put back to "disabled" with default values.  

Aug 30, 2011 at 7:13 PM

This could be because you don't have write permission on app_data folder. Take a look at this post on setting up BE on Godaddy. there is "file manager" that let you set write permissions.

Aug 31, 2011 at 12:54 PM

I agree with rtur.  I was just looking at this code, and not being able to set the web.config mod date won't affect the ability to save the enable/disable setting for an extension.  And on recycle, the new setting will take effect.  So if the setting isn't getting written, it's most likely because the site doesn't have write permissions to the app_data folder.

Aug 31, 2011 at 7:01 PM

I'm pretty sure I set write permissions to App_Data.  But will double check that.  

If worse comes to worse, what would happen if I just manually edit the XML in the be_DataStoreSettings table, set "enabled" to true there and then restart the app?  Would that do it, or are there more settings stored somewhere else?  

Thanks for all the help.