UBBCentral

Unable to open config.inc.php for writing. Please check permissions on the file.

Posted By: luket

Unable to open config.inc.php for writing. Please check permissions on the file. - 05/02/16 08:44 PM

Hi guys.
I just migrated my message board ( 7.5.9 ) to a new webserver.

All looks good (content displays) but when I go to open the board, I get the message:
Unable to open config.inc.php for writing. Please check permissions on the file.

I moved from Plesk 9.5 on a Windows Server 2005
-to-
Plesk 12 on a Windows Server 2012

BIG jump, pretty amazed all is working so well.
So I need to know what "user" needs what access to the config.inc.php ?

As a test I added "Everyone - Full Access" to that file only to open the board, then removed that liberal access.
After opening the board, posting works, and all is well.

So I'm pretty sure the migration worked, database is ok, etc...
I think what isn't ok is any writable PHP files.
Posted By: isaac

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/02/16 08:47 PM

Give "SYSTEM" read/write/ownership of your UBB.threads directory.

This will allow the "current machine" to make the file changes, as needed.
Posted By: luket

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/02/16 08:58 PM

id242,

SYSTEM already has full access to that file, so that's not the problem.
Also, it's not that I (as an administrator of the machine) can't edit the file, but rather UBB.Threads Control Panel can't edit the file.

UBB.Threads Control Panel must assume some user identity when it's updating PHP files (and it's certainly not SYSTEM access.)
It's that identity I am seeking.

Posted By: isaac

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/02/16 09:06 PM

Your permissions were "lost" (different user) when moving the directories from your old server to your new Windows server.

Take a look at the other WWW files/directories outside of your forums directory. When doing a fresh install of UBB.threads, those are the same permissions given, since it technically was "the server doing the install." These are the same ownership permissions you want to give to the "new" files you've just added.

The permission needs to be given to the directory. The config.ini.php file is not actually not "changed."
But instead, UBB.threads creates a new one with each settings change. Then it overwrites the old file with the new file.
So the folder's read/write permission needs to be set.
Posted By: isaac

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/02/16 09:20 PM

sending you a screenshot in PM
Posted By: luket

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/03/16 05:52 AM

Okay, solved.

On Plesk 9.x, Plesk created "users" for each web/domain which are the user accounts that access web resources like php and HTML files.
Under Plesk 9.x these users were called: PLESK IIS User (hostname\IUSR_someusername)
This "user" under 9.x had the "full control" to do things like modify config.inc.php.

Plesk 12 (at least) changed this model an went with a 'least privilege' model. Additionally, they renamed this user so as to make it a bit tougher to locate.
Under plesk 12 this user is: IWPG_someusername. By default this user only has 'read' permission. By granting this user 'full control' on this file UBB Threads Control Panel can now modify config.inc.php to do things like "close the message boards".

Now, with this said, I understand I may have to grant this access to other files and possibly even directories (if all the files in that directory require read/write permissions.)

PS. id242, I checked and both my old working server and the new one has the SYSTEM access you had described on the "includes" folder. The difference was the special user account that Plesk creates to read/write/execute web/domain files described above.
Posted By: isaac

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/03/16 05:58 AM

My bad. I totally missed the whole "Plesk" part and only saw "Windows."

I'm glad that you got it all worked out. I do hope that you didn't have to spend a lot of time on it.

Good stuff and nice follow-up post!
Posted By: luket

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/03/16 10:51 PM

Sure np.

By the way, the changes I describe above need to be applied to the /includes directory since everything in there is written to, like forum inserts and such. No need to do the individual files, just give IWPG_someusername read/write permission the the directory.

Posted By: Gizmo

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/03/16 10:56 PM

You should apply that to the entire UBB.threads directory; or, if you insist on doing it per directory, it'd need to be applied to:
/cache
/cache_builders/custom
/gallery
/images (if you want to allow uploads from the control panel)
/includes
/languages (if you want to be able to use the editor)
/sessions
/styles (if you want to be able to create/manage styles)
/templates/compile
/tmp
/uploads (if you're using this directory for uploads)
Posted By: isaac

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/03/16 11:12 PM

Luket, since you moved your forum from one server setup to another setup, did you run the "Permission Check" within the CP?

Control Panel > Tools & Information

http://www.EXAMPLE.com/forums/admin/fileperms.php

"This page will test to make sure all files and directories have the proper permissions. Note that not all of these permissions are required for your forum to be operational. Some of these permissions are only used in the control panel, for example the languages. You only need to change these permissions if you want to update your language files in the control panel. "
Posted By: luket

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/04/16 12:30 AM

I did, Permission check doesn't catch this situation:
Code
cache (OK)
cache_builders/custom (OK)
gallery/137/full (OK)
gallery/137/medium (OK)
gallery/137/thumbs (OK)
gallery/default/full (OK)
gallery/default/medium (OK)
gallery/default/thumbs (OK)
gallery/index.html/full (OK)
gallery/index.html/medium (OK)
gallery/index.html/thumbs (OK)
images/avatars/default (OK)
images/forumimages/default (OK)
images/graemlins/default (OK)
images/graemlins/default_dark (OK)
images/icons/default (OK)
images/icons/default_dark (OK)
images/markup_panel/default (OK)
images/markup_panel/default_dark (OK)
images/news/default (OK)
images/news/default_dark (OK)
images/moods/default (OK)
images/moods/default_dark (OK)
includes (OK)
languages/english (OK)
languages/english/admin (OK)
sessions (OK)
styles (OK)
templates/default (OK)
tmp (OK)


Not sure, but maybe Permission Check is simply looking at the file system permissions, and not what access the 'user account' has.
I think for permission check to catch this error, it would need to actually open the file for writing() to make the determination.

Thanks Gizmo for the list. I will make these updates pronto.
Posted By: Gizmo

Re: Unable to open config.inc.php for writing. Please check permissions on the file. - 05/04/16 12:33 AM

That's strange that it'd list everything as ok when they can't be written to (since the permissions aren't open for them), but then again, Windows servers can have some "special" quirks.
© 2018 UBB.threads PHP Forum Software Community