MyBB Community Forums

Full Version: Stuck in mid-upgrade
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The upgrader will not let me continue upgrading. My server does not allow PHP to have write permissions under any circumstances. So I am stuck at "Unable to open inc/config.php"

I bypassed this and other write requirements by editing the code myself. I also had ran into an inc/settings.php write error, which I removed, but I couldn't tell why it needed write permissions, so the settings file is probably missing something.
If PHP doesn't have write permissions on your server, a lot more will be broken, such as the MyBB cache system used even for CSS.
Good software is flexible software. MyBB is pretty good, but it should be able to accommodate non-write permission installs. Different system administrators set up servers differently for security reasons, there isn't one accepted method. If there are no write permissions, the installer/upgrader should display an error as well as explain a work around for those who can't don't have write permissions or can't change them, or whatever the reason may be. I would hope that the cache system has a settings switch or checker.

Just a note: I transferred servers, which is why I was able to install/upgrade in the past.

An example of bad software is cPanel. I would hope that any programmer who has used cPanel knows what I mean. I don't meant to bash cPanel, but it has that feel, and there are definitely some poorly programmed components. Don't be cPanel.
You might just have to complain to the host
1. Hosting is provided locally for free.
2. The server is probably more secure than a large percentage of web servers in the world. This is a good thing™.
3. Programmers are supposed to create programs that adapt to the environments. But I suppose these circumstances are mostly rare.
The settings have to be stored somewhere. It can't be stored in the database, because half of the settings contain database information. I can't think of many forums/CMS's you can run without write access.
From my understanding of playing around with MyBBoard about a year ago, most settings are stored in a database table. But I'm not following your logic. (However, before starting off, I should mention that I don't know MyBB well enough, so I'm making some assumptions. Correct me if I'm wrong. Or don't correct me at all, because it probably doesn't really matter.)
  1. When settings are saved: settings are stored in table, then mirrored to the cache. The script calls the cache whenever it can, because it's supposedly more efficient.
  2. If a setting were to be added for enabling/disabling write permissions, this may at first seem impossible, but it's not. There's two ways about it:
    • Obviously if a cache exists, write permissions are disabled, or it's a clean install. Because the cache doesn't exist, call from the database. I'm betting a clean install does this on it's first "run" anyway.
    • A cache can be created during the installation process. Those without write permissions will be prompted to fix the write permissions, or copy a provided cache file contents to a new file to the cache directory. When board script is loaded, it loads from the cache first, sees that write permissions is disabled, and loads from the database.
When developing software, I try to accommodate as many users as possible. (The major problem with my code, I admit, is that it hasn't been tested on a variety of web environments, so this can be difficult.)

Honestly:
This issue, again, is probably rare. I suppose I should not have brought it up. Nor should I have put such effort into this post.
My logic was: explain how MyBB can create and edit tables if it can't store the database and other settings in settings.php and config.php? And I would think MyBB would run horridly without a cache system.
You have to manually change your existing inc/config.php to match the MyBB 1.4 inc/config.php format. See [wiki]inc/config.php[/wiki] for an example.

In install/resources/upgrade12.php, find:
	$output->print_footer("12_redoconfig");
Replace with:
	$output->print_footer("12_dbchanges6");

After, continue with the upgrade process. Hopefully you don't need to restart from the beginning.

And to answer your previous questions...
(2008-08-15, 05:44 AM)Slythfox Wrote: [ -> ]1. Hosting is provided locally for free.
1. What you pay is what you get™.
(2008-08-15, 05:44 AM)Slythfox Wrote: [ -> ]2. The server is probably more secure than a large percentage of web servers in the world. This is a good thing™.
2. I know!!! If you disconnect the server from all networks, your MyBB installation will be secure from all hackers! No more security patches for life™.
(2008-08-15, 05:44 AM)Slythfox Wrote: [ -> ]3. Programmers are supposed to create programs that adapt to the environments. But I suppose these circumstances are mostly rare.
3. Programmers will be able to read everybody's mind and prepare for all environments, for example:
a) only the first 50 lines of PHP code are allowed to be executed.
b) a database server which only allows 1 database table per database
c) Only FTP is allowed to run on the server, so all web traffic must go through FTP.
d) The only PHP function allowed is "echo".
Oh, that's easy: Have the user edit it. And surprise, I have an example.

Step 1: Notify the user of what they are getting themselves into.
[Image: install1ed9.th.png]

Step 2: Give the user the code when it's time.
[Image: install2wd6.th.png]

Steps 1 and 2 may be combined if necessary.

Guess what, MyBBoard's installer/upgrader basically does this already. All one would need to do is print the $configdata variable that contains the information that would normally be written to the file, like so:
echo "<pre>" .$configdata. "</pre>";

I think I'll go away now.

Edit:
(2008-08-15, 07:42 AM)DennisTT Wrote: [ -> ][...]
3. Programmers will be able to read everybody's mind and prepare for all environments, for example:
a) only the first 50 lines of PHP code are allowed to be executed.
b) a database server which only allows 1 database table per database
c) Only FTP is allowed to run on the server, so all web traffic must go through FTP.
d) The only PHP function allowed is "echo".
To truthfully say, I completely enjoyed your sarcasm. Smile Maybe it's because I'm not really a security person... my server admin is.
Pages: 1 2