1
charlieg
mainfile.php chmod error
  • 2008/1/23 19:42

  • charlieg

  • Just popping in

  • Posts: 20

  • Since: 2007/12/21


I have been trying for a few days to resolve this error. The chmod for my mainfile.php defaults to 644 although I reset it to 444 [as the warning in my admin page suggests]. I have contacted the server who says that they cannot find the fault and I should contact the script writer. Also, how do I open the mainfile.php so that I can read it and write if required? Thanks.

2
Anonymous
Re: mainfile.php chmod error
  • 2008/1/23 20:17

  • Anonymous

  • Posts: 0

  • Since:


Hi,

There are times when hosting companies talk a load of old shoemakers. It's got nothing to do with the file/script as you're not executing it.

When you try changing the CHMOD setting do you get an error message? If so, what is it?

Can you delete the file and upload a backup copy from your PC? If so then try it.

If you can't delete it then get your hosting company to do it for you. If the support guys can't do it then ask them to get their engineers to do it. Pester them until they sort it as having a readable mainfile.php is the worst security issue that you can have; it contains your database password which could well be the same as for your whole webspace/account.

Whilst it remains readable make sure that you you take regular and frequent database backups.

3
charlieg
Re: mainfile.php chmod error
  • 2008/1/23 21:54

  • charlieg

  • Just popping in

  • Posts: 20

  • Since: 2007/12/21


Thanks John. No, I dont get an error message, the log file says that the chmod has been carried out so I log off and then go back in to check and blimey it has gone back to 644. I tried to replace the file, but there is no replacement as it is server generated [I guess]. The fault occurred in the last 3 weeks and remains even when I delete the XOOPS package and re-install !! I will get back to them, the server, and gently point out that the solution must be their end since they generated the script? They must have a back up file somewhere and without it, my site cannot go public.

4
Anonymous
Re: mainfile.php chmod error
  • 2008/1/24 9:31

  • Anonymous

  • Posts: 0

  • Since:


Just one thought.....

I'm wondering if there's a "hidden" file in your root directory - something like .htaccess - which is preventing the changes being made. It might have been put there by your host automatically?

You should be able to set your FTP client to view these files. In CuteFTP (which I use) you can view these files by

1. Selecting "Filter" from the Edit menu
2. In the "Options" tab, checking the "Enable remote filters (Server applied filter)" entry
3. Entering "-rtaF" (without quotation marks) in the box

HTH

5
xgarb
Re: mainfile.php chmod error
  • 2008/1/24 10:44

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


sticking this in a file in your htdocs should fix it..

<?php 
chmod
("mainfile.php"0444
?>


I found after an upgrade by my host that this was the only way to do it. FTP clients would fail.

6
charlieg
Re: mainfile.php chmod error
  • 2008/1/24 15:40

  • charlieg

  • Just popping in

  • Posts: 20

  • Since: 2007/12/21


Thanks John and xgarb, I am still on an Everest of a learning curve so here goes. John, I found .htaccess in the root menu and managed to read it but there did not seem to be any untoward entries, some 10 in total [but then I am not sure what to look for]. I also went into the script for mainfile.php to see if there might be a nasty hidden in there, I can copy the bit that I was curious about to you, but I don't want to put it on here.
xgarb, a bit of grade 4 stuff here, htdocs is what or where? I am happy to put that chmod command in there - makes sense to me - just got to find it !! Thank you for your time and excuse my stupidity. Charlie.

7
Anonymous
Re: mainfile.php chmod error
  • 2008/1/24 16:18

  • Anonymous

  • Posts: 0

  • Since:


Hello charlieg,

No need to copy any code.......

There's nothing in the standard XOOPS installation process that would put a .htaccess file in your xoops_root folder. I other words, the .htaccess file is nothing to do with xoops.

Use your FTP software to move the .htaccess file to another directory (make a folder and put it in there!) and then try to change the CHMOD setting on mainfile.php

By "htdocs", xgarb is referring to your xoops_root folder on your server. In the XOOPS download package the XOOPS files are contained in a folder called "htdocs".

Let us know how you get on.

8
charlieg
Re: mainfile.php chmod error
  • 2008/1/25 13:33

  • charlieg

  • Just popping in

  • Posts: 20

  • Since: 2007/12/21


A trillion thanks guys, a combination of the fixes that you suggested seems to have done it. No more 644, Darned good show, now to finish building. John, I am only an hour from you, I will nip down and buy you a beer in the future, thanks again, Charlie.

9
Anonymous
Re: mainfile.php chmod error
  • 2008/1/25 14:19

  • Anonymous

  • Posts: 0

  • Since:


Exzcellent news

Quote:
charlieg wrote:

John, I am only an hour from you, I will nip down and buy you a beer in the future, thanks again, Charlie.


Nnot necessary, but if you insist..........

10
irmtfan
Re: mainfile.php chmod error
  • 2008/1/25 19:35

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


maybe its late but i should say:
"most hosting companies dont allow a 444 chmode via ftp" presumably they think it a security flaw.

but you can set chmode by running a script ( as xgarb describe) or via cpanel --> file manager

if you still cant change the chmode of a file/folder contact to your hosting provider.

Login

Who's Online

189 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 189


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