File Permissions help

Tony

New member
Joined
Dec 9, 2003
Messages
2
Hi

My workplace uses a 1&1 hosting account but I use HostLogical and I am having problems with file permissions. I have taken a simple perl script which runs at work on 1&1 and have recreated the same structure and filenames on my HostLogical site. I have no problem running a script until it tries to open a text file for writing.

open(OUTPUT,">> ../storeage/mydocument.txt") or die $1;

Although I have set the permissions 755 for the perl script (in the cgi-bin directory and set 666 or 777 for the text file I still get either

fopen: Permission denied
or more recently
(13)Permission denied: .htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

errors created in my log file. I don't really know what they mean. I have read some similar posts for permissions and can't find the .conf files which some of the responses refer to.

What do I need to do to ensure the correct permissions are set in the directories I need them?

If I need to edit .conf files, where do I find them...do I need to create them first...and can I do all this through the DirectAdmin File Manager (which is where I've been playing with the permissions so far)?

Thanks is advance for helping me with this.

Tony
 
Hello,

Your perl script should be already running as the correct username, so you wouldn't need anything more than 755. (700 would in theory work too). The only thing that I could think of is that "storeage" doesn't exist, or is spelt incorrectly ("storage" ??)

Also check the contents of any .htaccess file in either directory that might be denying the script to write anything. (Test it without the .htaccess file.. if one exists)

John
 
Thanks John

You're right, the script should already be running...and in fact it now is.:D I ended up deleting my files and directories and started again...this time using WS_FTP instead of doing everything through the DirectAdmin File Manager. I made a point of making sure I used ASCII for upload of my perl scripts and my text file storage, and then with CHMOD set the maximum permissions. I was actually a little surprised when my script application worked this time.

Do you think my problem was simply my original upload of files using File manager (perhaps defaulting to binary mode). If it was binary mode with File Manager is there a way to upload with File Manager in ASCII mode (other than just creating the file live followed by a copy and paste of the contents)?

Anyway, thank you for your support. I shall try some permutations with File Manager so that I find the reliable mechanism. I am happy now that I've seen my familiar script working normally. HostLogical seems like a very good choice to me.

Thanks

Tony
 
Back
Top