For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > April 2004 > Re: [PHP-INSTALL] HELP Permission Error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-INSTALL] HELP Permission Error
Chris Hewitt

2004-04-15, 2:37 pm

Bruce wrote:

>New to PHP/MySQL. I have RH9/Apache/MySQL/PHP running. I want to upload a
>file. But, I have a permission error message I'm receiving. Does anyone
>know where I can look
>
>Warning: Unable to create '65.jpg': Permission denied in
>/home/budgetn/www/html/_new_admin/p_add_staff.php on line 42
>

The user that the webserver is running as needs permission to create the
file in the directory you specify. You have not told us which directory
or what the permissions on it are, but I suspect this is the problem. I
think in RH9 apache httpd runs as user "apache", if not its "httpd".

Hope this helps.

Chris
Bruce

2004-04-15, 4:32 pm

Thanks -- after some experimenting... I set the permissions to 777 on the
directory. The file transferred okay.... Now, I'm on how to get
the virtual domain to own the uploaded file and correct the permissions.
Any ideas.

Bruce
"Chris Hewitt" <g0pae@manordat.demon.co.uk> wrote in message
news:407ECED4.9090403@manordat.demon.co.uk...
> Bruce wrote:
>
a[color=darkred]
> The user that the webserver is running as needs permission to create the
> file in the directory you specify. You have not told us which directory
> or what the permissions on it are, but I suspect this is the problem. I
> think in RH9 apache httpd runs as user "apache", if not its "httpd".
>
> Hope this helps.
>
> Chris

Jeffrey N Dyke

2004-04-15, 4:32 pm


The easist thing is to chage the ownership of the directory to be the
webserver user. so maybe...
chown httpd:apache /path/to/directory

Then you can alter the permissions to restrict access.
chmod og-w /path/to/directory
removes the write persmission for the group and 'other'

the user/group and directory are fake names that will most likely differ
for your system.

Some opinions may differ, but when i have an upload directory i give the
webserver onwnership of that dir and remove access to all other users so
only root can delete/modify...and sometimes even execute to keep that
'open' part of your system, locked down to others.

HTH
Jeff





Thanks -- after some experimenting... I set the permissions to 777 on the
directory. The file transferred okay.... Now, I'm on how to get
the virtual domain to own the uploaded file and correct the permissions.
Any ideas.

Bruce
"Chris Hewitt" <g0pae@manordat.demon.co.uk> wrote in message
news:407ECED4.9090403@manordat.demon.co.uk...
> Bruce wrote:
>
a[color=darkred]
anyone[color=darkred]
> The user that the webserver is running as needs permission to create the
> file in the directory you specify. You have not told us which directory
> or what the permissions on it are, but I suspect this is the problem. I
> think in RH9 apache httpd runs as user "apache", if not its "httpd".
>
> Hope this helps.
>
> Chris

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com