1
Lisa_S
Could not write into mainfile.php
  • 2003/11/5 10:59

  • Lisa_S

  • Just popping in

  • Posts: 13

  • Since: 2003/1/30


Ok, before you go telling me to CHMOD it, already been there done that and it is still coming up with the following error:

Saving configuration data..
Could not write into mainfile.php. Please check the file permission and try again.

Which is really screwy because two install screens before that one, it did a test on the permissions to see if there were any errors, they all came up ok ie, writeable. So why won't it save to the mainfile.php NOW!?

I've done a search, tried replacing the mainfile with the contents of mainfile.dist.php and replacing my details in it... but no go.

What do I do?

2
ronhab
Re: Could not write into mainfile.php
  • 2003/11/5 12:00

  • ronhab

  • Friend of XOOPS

  • Posts: 160

  • Since: 2003/4/27


You can open it up and edit the contents manually. The file is pretty well commented and laid out so that you can see what is what.

Just don't forget to chmod it back (444) since the only time it needs to be written to is during the install.

HTH.

3
Lisa_S
Re: Could not write into mainfile.php
  • 2003/11/5 18:31

  • Lisa_S

  • Just popping in

  • Posts: 13

  • Since: 2003/1/30


Uh... I tried that (as I said in my previous post)

"I've done a search, tried replacing the mainfile with the contents of mainfile.dist.php and replacing my details in it... but no go"

When I do that and hit refresh, the error still comes up and the installation won't move past that point.

Can anyone help me out on this?

4
Herko
Re: Could not write into mainfile.php
  • 2003/11/5 18:40

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


looks like there's something wrong with the installer file, since it is not detecting the file access correctly. You can either reupload the install folder and try again, or look in the code and disable the file access rights check for that part...

Herko

5
Lisa_S
Re: Could not write into mainfile.php
  • 2003/11/5 20:05

  • Lisa_S

  • Just popping in

  • Posts: 13

  • Since: 2003/1/30


Thank you...

Ok, I reuploaded the install folder fresh but no go again.

I am looking in code now to find file access checks but can't see them yet. I don't know a great deal about php, just enough to get by and edit/fix some things. Could you be more specific so I can find the right lines easier?

: )
-Lisa

6
Herko
Re: Could not write into mainfile.php
  • 2003/11/5 20:11

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


OK, this is the first time I'm doing this, but line 158 of install/index.php that's where the array of files and folders is set to see if it's writable or not. Try removing the reference to mainfile.php there, making the code
$writeok = array("uploads/""cache/""templates_c/");


Lets wee what this does

Herko

7
Lisa_S
Re: Could not write into mainfile.php
  • 2003/11/5 23:07

  • Lisa_S

  • Just popping in

  • Posts: 13

  • Since: 2003/1/30


Hmm it didn't seem to make any difference. I noticed something though but I don't know what it means. The error I am getting is defined as:

Quote:
define("_INSTALL_L60","Could not write into mainfile.php. Please check the file permission and try again.");


so I went and searched thru index.php for the install_l60 thing and it is here:

Quote:
case "dbsave":
include_once "./class/mainfilemanager.php";
$title = _INSTALL_L88;
$mm = new mainfile_manager("../mainfile.php");

$ret = $mm->copyDistFile();
if(! $ret){
$content = _INSTALL_L60;
include 'install_tpl.php';
exit();
}

$mm->setRewrite('XOOPS_ROOT_PATH', $myts->stripSlashesGPC($HTTP_POST_VARS['root_path']));
$mm->setRewrite('XOOPS_URL', $myts->stripSlashesGPC($HTTP_POST_VARS['xoops_url']));
$mm->setRewrite('XOOPS_DB_TYPE', $myts->stripSlashesGPC($HTTP_POST_VARS['database']));
$mm->setRewrite('XOOPS_DB_PREFIX', $myts->stripSlashesGPC($HTTP_POST_VARS['prefix']));
$mm->setRewrite('XOOPS_DB_HOST', $myts->stripSlashesGPC($HTTP_POST_VARS['dbhost']));
$mm->setRewrite('XOOPS_DB_USER', $myts->stripSlashesGPC($HTTP_POST_VARS['dbuname']));
$mm->setRewrite('XOOPS_DB_PASS', $myts->stripSlashesGPC($HTTP_POST_VARS['dbpass']));
$mm->setRewrite('XOOPS_DB_NAME', $myts->stripSlashesGPC($HTTP_POST_VARS['dbname']));
$mm->setRewrite('XOOPS_DB_PCONNECT', intval($HTTP_POST_VARS['db_pconnect']));
$mm->setRewrite('XOOPS_GROUP_ADMIN', 1);
$mm->setRewrite('XOOPS_GROUP_USERS', 2);
$mm->setRewrite('XOOPS_GROUP_ANONYMOUS', 3);

$ret = $mm->doRewrite();
if(! $ret){
$content = _INSTALL_L60;
include 'install_tpl.php';
exit();
}


as well as here:

Quote:
case 'updateTables_go':
include_once "../mainfile.php";
$error = false;
$g_webmasters = isset($g_webmasters) ? intval($g_webmasters) : 0;
$g_users = isset($g_users) ? intval($g_users) : 0;
$g_anonymous = isset($g_anonymous) ? intval($g_anonymous) : 0;
if (empty($g_webmasters) || empty($g_users) || empty($g_anonymous)) {
$error = true;
} else {
include_once "./class/mainfilemanager.php";
$title = _INSTALL_L88;
$mm = new mainfile_manager("../mainfile.php");
$mm->setRewrite('XOOPS_GROUP_ADMIN', $g_webmasters);
$mm->setRewrite('XOOPS_GROUP_USERS', $g_users);
$mm->setRewrite('XOOPS_GROUP_ANONYMOUS', $g_anonymous);

$ret = $mm->doRewrite();
if(!$ret){
$content = _INSTALL_L60;
include 'install_tpl.php';
exit();


To me it looks like something to do with databases? This does not seem right but could it be possible that one of the entries I have for the configuration be wrong - like wrong database name, user, password or something like that?

Any more suggestions? I don't want to delete the database as I was told that once i removed the old files from ver. 1.3.10, and uploaded the new files for 2.05 and installed, it would automatically detect my existing database and upgrade/install etc.

Thanks

8
Lisa_S
Re: Could not write into mainfile.php
  • 2003/11/6 18:47

  • Lisa_S

  • Just popping in

  • Posts: 13

  • Since: 2003/1/30


Still haven't fixed this issue... help anyone? I'd like to get XOOPS installed!

9
Anonymous
Re: Could not write into mainfile.php
  • 2003/11/11 22:16

  • Anonymous

  • Posts: 0

  • Since:


Same problem for me...
don't know what to do, changed mainfile.php and imported the .sql data in MySQL databases, but in the homepage, there is a blank page!

hints?

i previously installed XOOPS 2.0.4 on a FREE HOSTING, now i bought a domain... it's hosted on Win2000, i'd like to make my XOOPS work...

thank you

Lisa_S: if i find something, i'll post here ;)

10
DFBH13
Re: Could not write into mainfile.php
  • 2003/11/11 23:43

  • DFBH13

  • Just popping in

  • Posts: 61

  • Since: 2003/6/26


ive had these problems 2.

Just deleted all files and re uploaded.

Worked fine

Login

Who's Online

220 user(s) are online (160 user(s) are browsing Support Forums)


Members: 0


Guests: 220


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits