MyBB Community Forums

Full Version: Help! Stuck in upgrade to 1.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I followed all steps on the wiki upgrade page, and the upgrade script was moving along nicely until the following error message:

Unable to open inc/config.php
Before the upgrade process can continue, you need to changes the permissions of inc/config.php so it is writable.


Going back to my FTP app, I double-checked and sure enough, config.php is properly set to 666: read/write all the way across. I've set and reset it again and again, closed it and reopened to be sure settings took - they did.
But the MyBB upgrade script just isn't buying it.

Where do I go from here?
That's odd. Have you tried reuploading the config.php? Maybe it's corrupted.
Does /inc/ itself have the right permissions?

Otherwise, do as Renegader said and try re-uploading it again.
Since the upload\inc folder does not contain a config.php file to overwrite the installation version, I assume you're suggesting reuploading an original version that I'd backed-up?
Yes, I did that from a couple different saved locations (one recent and one dating back to '07), but the results are the same.

Good suggestion, though!
(2011-01-04, 04:58 AM)Chase Wrote: [ -> ]Does /inc/ itself have the right permissions?
Uh, it didn't but now it's CHMOD 777.Blush

But the upgrade script still doesn't seem to care.
okay, interesting: the config-default.php that expanded in the \upload\inc folder is 0bytes in size.

Should I redownload the 1.6 installation and pull a hopefully correct version of config-default.php from there? Or is the file supposed to be empty?

Edit: answered that question: another download shows that THAT config-default.php is ALSO empty.

So that leaves me confused, Chase: am I supposed to be loading an empty config-default.php file with the same ASCII-data content as my OLD config.php, then renaming it to config.php?

thanks very much for your assistance, by the way...
Delete the config-default.php file from inc folder and upload config.php from your backup and make sure that config.php file is chmoded to 777. Also make sure inc/settings.php file is chmoded to 777

inc folder does not need to be 777
That file is empty when MyBB is installed. It 'grows' and renames itself to config.php when you complete an installation.
config.default.php has nothing to do with anything, that's just an empty file that comes included for new installations, it's not special or necessary for anything, it's just an empty file with a name.

This is weird though... after a quick search this error has only ever come up twice before, and both times CHMODing it worked, as that's all it needs... it gives this error if it can't open the file to write the new config details...

$fh = @fopen(MYBB_ROOT."inc/config.php", "w");
if(!$fh)
{
	echo "<p><span style=\"color: red; font-weight: bold;\">Unable to open inc/config.php</span><br />Before the upgrade process can continue, you need to changes the permissions of inc/config.php so it is writable.</p>";
	$output->print_footer("17_redoconfig");
	exit;
}

If you've set it to be writable but the server still can't write to it, I think you'll need to ask your host what's stopping it. You haven't got any extra .htaccess protection rules on config.php or anything have you??

Try this, in your root folder (i.e. where index.php, online.php, member.php, search.php etc is) make a file called test.php or something, and put this in it:

<?php
var_dump(is_writable("inc/config/php"));
?>

What does it output when you run it in your browser??
(2011-01-04, 12:03 PM)MattRogowski Wrote: [ -> ]Try this, in your root folder (i.e. where index.php, online.php, member.php, search.php etc is) make a file called test.php or something, and put this in it:

<?php
var_dump(is_writable("inc/config/php"));
?>

What does it output when you run it in your browser??
Matt, when I run that code I get a
bool(false)
...I guess that spells it out, don't it?

I'm currently awaiting an answer from my hosting guy regarding any blocks to config.php writes...thanks for your diagnosis so far!
Yep, it's a host issue then. And if they turn around and say it's an issue with MyBB (which hosts often do Rolleyes ) you can see it's not, as that script, which clearly doesn't run any MyBB specific code, also says that the file isn't writable.
Pages: 1 2