NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 11-05-2005 05:10:38

Pinkie
Member

Problems with CHMODing

It was bit ironic that I had all of my notice.php's and config files were CHMOded to 666 becuase I never like to read manuals. Luckily no harm was done.

So anyway... my oekaki was transferred to another host not too long ago. Well... now I've CHMODed all of the config files, notices, news, etc to 644

Even when CHMODed to 644 I recieve this error:

notice.php is locked! CHMOD the file so it is writable.

I have deleted the file off the server, the re uploaded it and CHMODed it to 664, but still it doesn't work. I think this is something to do with how my host is handling CHMOD values... any idea on what I can do and if I sould contact the owner of my host? I'm 102% sure I definately have it CHMODed to 664.  I've read somewhere on the forums that php needs to create these files... or whatever. If you need to code something up, I'll only need to be able to write to the files notice.php. I'm pretty comfortable with editing any config files and uploading the changed file to via FTP; it's not everyday I change the configuration anyway, and I never have used news.php.

Thanks for reading this.

Offline

#2 11-05-2005 22:51:10

Waccoon
Administrator

Re: Problems with CHMODing

Try 664 instead of 644.

The middle digit controls security for groups.  Since FTP and PHP are often assigned to different security groups on servers, you may have to give higher access levels for groups.  Realisticly, so long as the public group (the last digit) is low, there shouldn't be a problem.  So much security is handled by PHP and the web server these days, that CHMOD numbers aren't as critical as they used to be.

A decent breakdown of CHMOD is here.

A CHMOD number generator is located here, which is useful if your FTP program doesn't have graphical buttons for owners, groups, and public permissions.

Offline

#3 11-06-2005 08:09:10

Pinkie
Member

Re: Problems with CHMODing

I've CHMODed it to 664, and 644 but it still doesn't work. It only works when CHMODed to 666... but obviously that gives write acsess to the public. Any ideas?

Offline

#4 11-07-2005 01:23:23

Waccoon
Administrator

Re: Problems with CHMODing

WTF?

OK, I'll modify my reclaim script to recover banners, notices, and other stuff, not just config files.  That should fix it.

Offline

#5 11-07-2005 02:17:10

Waccoon
Administrator

Re: Problems with CHMODing

OK, try this script to unlock the files:

reclaim.zip

Offline

#6 11-16-2005 21:48:54

Hanako
New member

Re: Problems with CHMODing

:3 Oh! Yay xD I have the same problem. How do we use the reclaim script? *is php impaired* xD

Offline

#7 11-17-2005 04:48:53

Waccoon
Administrator

Re: Problems with CHMODing

Upload it to the oekaki folder (the same folder that has "index.php" in it).  Then, just type its name in the address bar instead of the index:

www.mysite.com/oekaki/reclaim.php

It'll let you know what is OK and what is not.  If you're using a Windows server, you may have temp files left over that all end with "_old.php".  You can safely delete those.  For some idiotic reason, many UNIX programs ported to Windows have trouble deleting files.  I think there's a single UNIX emulator used for all the major programs (like Perl and PHP), that has just never been fixed.

It's a good idea to delete the reclaim script once you're done with it.

Offline

#8 11-19-2005 14:34:00

Hanako
New member

Re: Problems with CHMODing

Okay I did it and this is what the errors appear to be big_smile

Warning: rename(hosts.txt,hosts_old.php): Permission denied in /home/picormdwe/domains/picormdwe.com/public_html/oekaki/reclaim.php on line 19
FAIL: Cannot delete temp file hosts_old.php

Warning: rename(announce.php,announce_old.php): Permission denied in /home/picormdwe/domains/picormdwe.com/public_html/oekaki/reclaim.php on line 19
FAIL: Cannot delete temp file announce_old.php
SKIPPED: banner.php (does not exist)

Warning: rename(notice.php,notice_old.php): Permission denied in /home/picormdwe/domains/picormdwe.com/public_html/oekaki/reclaim.php on line 19
FAIL: Cannot delete temp file notice_old.php

I have no idea why this is happening but it's all on line 19 and I can't edit news and notice still ^^;;

Last edited by Hanako (11-19-2005 14:35:33)

Offline

#9 11-20-2005 00:40:08

Waccoon
Administrator

Re: Problems with CHMODing

Rats.  Try CHMODing the affected files to something rediculously lame (like 775) and run the reclaim script again.  If that still doesn't work, then the files are beyond the script's access, and you'll have to fix it manually.

Download the files to your computer via FTP, delete the files from your server, and re-upload and CHMOD them to 664.  If you can't even delete them withyour FTP program (as I expect will happen), you'll have to ask your system admin to do it for you.  Sometimes UNIX servers do this, and it's a real pain.

Make sure you do this only to hosts.txt, announce.php, and notice.php.  If you touch the config and dbconn files, there's no telling what will happen.  wink

Offline

#10 11-23-2005 13:02:35

Pinkie
Member

Re: Problems with CHMODing

Waccoon wrote:

Rats.  Try CHMODing the affected files to something rediculously lame (like 775) and run the reclaim script again.  If that still doesn't work, then the files are beyond the script's access, and you'll have to fix it manually.

Download the files to your computer via FTP, delete the files from your server, and re-upload and CHMOD them to 664.  If you can't even delete them withyour FTP program (as I expect will happen), you'll have to ask your system admin to do it for you.  Sometimes UNIX servers do this, and it's a real pain.

Make sure you do this only to hosts.txt, announce.php, and notice.php.  If you touch the config and dbconn files, there's no telling what will happen.  wink

I get the following error:

I was getting the same results as Hanako. I tried to CHMOD it to 775, as well as deleting and uploading & re-CHMODing the files (I only did this for announce.php, hosts.txt and notice.php becuase I wouldn't want to crash my oekaki while users were drawing & with no warnin).

Warning: rename(dbconn.php,dbconn_old.php): Permission denied in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/normal/reclaim.php on line 19
FAIL: Cannot delete temp file dbconn_old.php

Warning: rename(config.php,config_old.php): Permission denied in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/normal/reclaim.php on line 19
FAIL: Cannot delete temp file config_old.php

Warning: rename(ips.txt,ips_old.php): Permission denied in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/normal/reclaim.php on line 19
FAIL: Cannot delete temp file ips_old.php

Warning: rename(hosts.txt,hosts_old.php): Permission denied in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/normal/reclaim.php on line 19
FAIL: Cannot delete temp file hosts_old.php
OK: announce.php
SKIPPED: banner.php (does not exist)

Warning: rename(notice.php,notice_old.php): Permission denied in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/normal/reclaim.php on line 19
FAIL: Cannot delete temp file notice_old.php

Failed! If you're using Windows, wait 15 seconds and run this file again.
If using UNIX/Linux, check that there are no temp files and the original config files are named properly.

But why is announce.php OK? O.o I can delete the files withotu aproblem using FTP. On the same host I am running 2 subdomains. I tried running the reclaim script on one of the subdomains and it worked perfectly, but it won't work on my other domain. What should I do? If I need to contact the server admin, what do I ask him to do?  My host seems to be acting strangly.


It says to check if any temp files exist. Unless they are invisable to my FTP program, than no, I don't see any temp files created.

Last edited by Pinkie (11-23-2005 13:04:59)

Offline

#11 11-24-2005 22:44:08

Waccoon
Administrator

Re: Problems with CHMODing

What is the CHMOD number for announce.php?  I've run into issue before where a server caches perimissions on certain files, so even deleing them won't fix the issue.  UNIX servers really drive me nuts.

Really, what you have to do is tell your system administrator which files you need changed, and tell them that the files must be writable by PHP.  PHP and FTP often work on different security groups, so while one will work, the other may not.  This is a CHOWN issue, not CHMOD.

To be honest, I don't know much about CHOWN and UNIX groups, as I do all my testing on a Windows machine, and recently dumped my Linux box for a Macintosh, which isn't as UNIX-ish as Apple wants people to believe.

I am pretty surprised that you can delete the files in FTP, re-upload them, and the reclaim script still can't access them.  I had this problem all the time with my old Perl-based oekaki where pictures could not be deleted.  Since my web host moved to a new server, though, the problem went away.  It's probably best not to take chances, and to ask your admin.

It says to check if any temp files exist. Unless they are invisable to my FTP program, than no, I don't see any temp files created.

If the rename() function fails, sometimes the script says there may be temp files left behind.  They definately won't be invisible in FTP if they are there.

Offline

#12 12-01-2005 13:44:24

Pinkie
Member

Re: Problems with CHMODing

Oh... I just realised announce.php was still CHMODed to 666. Thanks for your help. The reason it worked for the other boadr on the host was purely becuase I ran install.php (not just moved over the files via FTP like with some of my other boards).

Offline

#13 12-11-2005 05:30:58

Hanako
New member

Re: Problems with CHMODing

D: I tried to make a whole new oekaki to see if I could get rid of the permission problem but my server must be touchy >_> These random errors popped up in the install.

Warning: fopen(announce.php): failed to open stream: Permission denied in /home/picormdwe/domains/picormdwe.com/public_html/normal_oekaki/install.php on line 192

Warning: fclose(): supplied argument is not a valid stream resource in /home/picormdwe/domains/picormdwe.com/public_html/normal_oekaki/install.php on line 193

Warning: fopen(notice.php): failed to open stream: Permission denied in /home/picormdwe/domains/picormdwe.com/public_html/normal_oekaki/install.php on line 200

Warning: fclose(): supplied argument is not a valid stream resource in /home/picormdwe/domains/picormdwe.com/public_html/normal_oekaki/install.php on line 201

If you did not recieve any errors, then the installation has completed. DELETE THIS FILE AND UPGRADE.PHP FROM THE SERVER TO PREVENT SECURITY BREACHES!

Nothing works. The reclaim script didn't work D: announce.php and notice.php refuse to work unless it's set to 666 or 777.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB