LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-30-2009, 01:24 AM   #1
hamidych
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Rep: Reputation: 0
[urgent] Can't upload files. Access Denied.


Hello guys,

I am having a problem with my fresh RedHat installation.
I have configured PHP, Apache, MySQL, etc. My web applications run fine. The only problem is: whenever I try to upload a file as an attachments in any of my web applications, it gives me a PHP error: access denied.

I already went extreme and granted 777 permissions on my /var/www/html directory. I have as well made apache:apache owner of that folder. I don't know what else to do.

So current situation is:
apache:apache is owner of the directory
permissions are set as drwxrwxrwx (777)
I still can not upload any attachments to that directory

Please help.
 
Old 09-30-2009, 01:27 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 220Reputation: 220Reputation: 220
Apache usually runs as nobody.

When you do a 'ps aufx' who owns the running httpd processes?

If it is running as nobody you can change this in httpd.conf
 
Old 09-30-2009, 01:32 AM   #3
hamidych
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Code:
apache   32709  0.0  0.4  39372 19092 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32710  0.0  0.5  42188 21532 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32711  0.0  0.4  38848 18144 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32712  0.0  0.4  38868 17920 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32713  0.0  0.4  38748 17812 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32714  0.0  0.4  38856 17944 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32715  0.0  0.4  39372 19208 ?        S    10:04   0:00  \_ /usr/sbin/httpd
apache   32716  0.0  0.5  42180 21480 ?        S    10:04   0:00  \_ /usr/sbin/httpd
 
Old 09-30-2009, 01:39 AM   #4
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
It may very un-likely, but I have to ask just to eliminate the possibility, the directory to which you're trying to upload, is it NFS mounted, or accessed through a symbolic link?

Another possibility is an access restriction that's imposed by Apache's functionality based on the way it's configured.

But to get a better idea of the context in which youre' working, are you working with Apache 1 or 2?

Is /var/www/html your doc root, and are you trying
to upload to that?
 
Old 09-30-2009, 01:43 AM   #5
hamidych
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
It's Apache 2

/var/www/html is the home dir and I am uploading to that

that directory is on local internal hard drive, not on some shared storage (if I got you correct)
 
Old 09-30-2009, 01:53 AM   #6
hamidych
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
I meant doc root by home dir...
 
Old 09-30-2009, 02:24 AM   #7
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 220Reputation: 220Reputation: 220
Could we see the PHP code snippet which is generating the actual error?
 
Old 09-30-2009, 04:22 AM   #8
hamidych
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Code:
Warning: mkdir() [function.mkdir]: Permission denied in /var/www/html/careers.amsi.ae/incs/functions.php on line 32

Warning: move_uploaded_file(../uploads/Passport1/1/Path.inf) [function.move-uploaded-file]: failed to open stream: No such file or directory in /var/www/html/careers.amsi.ae/incs/functions.php on line 35

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpXCOnfW' to '../uploads/Passport1/1/Path.inf' in /var/www/html/careers.amsi.ae/incs/functions.php on line 35
 
Old 09-30-2009, 08:47 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,873

Rep: Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600Reputation: 2600
Interesting error msgs, but we still want to see the php code...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ready-Made PHP program that lets me upload and access files on the web? apache2 Linux - Software 5 12-01-2008 10:48 PM
i have a site and want people to upload to it and access the files shadowofanubis66 Linux - Server 2 05-05-2008 06:44 AM
Cannot delete files, Access is denied tvu123 Linux - Networking 3 12-04-2005 02:47 PM
access denied upload file johnrage SUSE / openSUSE 8 11-29-2005 03:20 AM
FTP upload problem: Error 550 Access Denied andrewstr Linux - Networking 0 12-17-2003 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration