|
MWK
|
 |
« on: March 22, 2003, 01:08:00 PM » |
|
I am attempting to move a working PHP installation from one ISP to Lunarpages. I have a PHP script that needs to allow the webuser to manage an image directory. Currently, the script is getting the error "Permission denied" when it attempts to unlink() or copy() from the image directory.
On the previous ISP I needed to setup an ACL zone. But this is not available here.
I would like to permit the CGI/PHP script to have complete rights to the image directory.
I tried the "CGI wrapper" option and copied the script into the /scgi-bin directory and it did not work.
Any help would be appreciated.
Mike K
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #1 on: March 22, 2003, 05:44:00 PM » |
|
You need to either FTP into your account, or goto the file manager in CPanel.
Then, "CHMOD" the directory and files that you want to be writeable. This means changing the permissions on the files/directory.
If you need help, please write back
|
|
|
|
|
Logged
|
|
|
|
|
MWK
|
 |
« Reply #2 on: March 23, 2003, 05:46:00 AM » |
|
STEPHAN,
Thanks for the reply, but it is more than just the CHMOD permissions. The directory is currently 755 and the files are 644. I have only one user account, no group members. I changed one file to 774, and tried to unlink() it and it still failed.
What user does the CGI/PHP scripts use when they are run from the internet? The CGI wrapper stated it uses my account. But I can not prove it.
The script user needs to be given R/W permission to this one directory. What types of control can this user be given?
Do I need to have the webuser sign in?
Thanks again for any assistance,
Mike K
|
|
|
|
|
Logged
|
|
|
|
|
TWebMan
|
 |
« Reply #3 on: March 23, 2003, 08:32:00 AM » |
|
You'll have to still CHMOD the directory/files in question to 777. I don't remember what user php assumes, but, like perl, it will need to have files with full permissions set before it can change them.
|
|
|
|
|
Logged
|
"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila." - Unknown "Liberty of any kind is seldom lost all at once." - D. Hume Every day is an Ode to JoyThe planet will be fine... and so will your site
|
|
|
|
MWK
|
 |
« Reply #4 on: March 23, 2003, 11:01:00 AM » |
|
I just moved into the neighborhood. I don't think I want to leave all of my doors unlocked.
Doing a CHMOD to 777 would allow anyone on the same server to have total control to all the files in that directory.
There has to be a solution for this common need. The "scgiwrap" should have done the trick but I do not know if it has not been installed correctly or I am just missing something simple.
Thanks again for any and all assistance,
Mike K [ March 23, 2003, 07:02 PM: Message edited by: MWK ]
|
|
|
|
|
Logged
|
|
|
|
|
TWebMan
|
 |
« Reply #5 on: March 23, 2003, 11:09:00 AM » |
|
This is true, if someone's looking for that. You can create a directory NEXT to your public_html directory which won't be directly accessible from the 'net.
This is handy for files that need to be accessed by scripts, but not by people. Hope this helps.
|
|
|
|
|
Logged
|
"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila." - Unknown "Liberty of any kind is seldom lost all at once." - D. Hume Every day is an Ode to JoyThe planet will be fine... and so will your site
|
|
|
|
MWK
|
 |
« Reply #6 on: March 23, 2003, 11:29:00 AM » |
|
TWebMan,
Thanks for the help, but the images are referenced within the website so they will need to be within the public_html directory structure.
The other ISP that I am on currently allows for this type of access through a seperate utility that I cannot find here on Lunarpages. It is a SunOS box but they want three times the amount per month that Lunarpages is asking. I am just starting to build a little website for my daughter's wedding registry. I thought this would be a great time to learn PHP and MySQL, etc. I am now realizing why unix-like systems are not ready for prime time. Too many small differences that stop you in your tracks. You have to spend all your waking hours attempting to get around them.
Thanks again for being there,
Mike K
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #7 on: March 23, 2003, 06:10:00 PM » |
|
Lots of people have their files set to 777, it's ok, no one can get to them.
Well, at least, I'm pretty sure that's the case here, because otherwise, we would all be in trouble!
Sun computers do run a Unix based operating system. Which utility did you have on your last host? It might run on lunarpages.
PHP seems to create files with a username of "nobody".
|
|
|
|
|
Logged
|
|
|
|
|
TWebMan
|
 |
« Reply #8 on: March 23, 2003, 07:55:00 PM » |
|
For about 12 years, I've had, designed and maintaned several websites with ONE directory chmodded to 777 and I've never had a problem. Even if there were, it would be limited to that directory, and The chance of someone running malicious code there is practically nil. I really wouldn't be that concerned about it. I've had more problems on my Windows-based desktops than any server I ever worked with heheh !["" "[biggrin]"]("graemlins/biggrin.gif")
|
|
|
|
|
Logged
|
"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila." - Unknown "Liberty of any kind is seldom lost all at once." - D. Hume Every day is an Ode to JoyThe planet will be fine... and so will your site
|
|
|
|
MWK
|
 |
« Reply #9 on: March 23, 2003, 10:21:00 PM » |
|
Okay neighbors, I did a CHMOD to 777 for the image directory. I was able to unlink() a file successfully. But I still cannot upload a new image into it from the webpage.
What I can do to allow the webuser to create a new file in this directory?
Thanks again,
Mike K
|
|
|
|
|
Logged
|
|
|
|
|
TWebMan
|
 |
« Reply #10 on: March 24, 2003, 05:09:00 AM » |
|
I haven't had occasion to do that here, but I'll look into it !["" "[Wink]"]("wink.gif")
|
|
|
|
|
Logged
|
"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila." - Unknown "Liberty of any kind is seldom lost all at once." - D. Hume Every day is an Ode to JoyThe planet will be fine... and so will your site
|
|
|
|
MWK
|
 |
« Reply #11 on: March 24, 2003, 07:38:00 AM » |
|
WOW....
I tested again today and everything seems to be working. With and Without the "CGI wrapper".
Thank you good neighbors for all the assistance.
Mike K
P.S. If any Admin person changed anything I would like to know what changed. Please send me a message.
|
|
|
|
|
Logged
|
|
|
|
|