LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [urgent] Can't upload files. Access Denied. (https://www.linuxquestions.org/questions/linux-software-2/%5Burgent%5D-cant-upload-files-access-denied-758600/)

hamidych 09-30-2009 01:24 AM

[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.

foodown 09-30-2009 01:27 AM

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

hamidych 09-30-2009 01:32 AM

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


rigor 09-30-2009 01:39 AM

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?

hamidych 09-30-2009 01:43 AM

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)

hamidych 09-30-2009 01:53 AM

I meant doc root by home dir...

foodown 09-30-2009 02:24 AM

Could we see the PHP code snippet which is generating the actual error?

hamidych 09-30-2009 04:22 AM

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


chrism01 09-30-2009 08:47 PM

Interesting error msgs, but we still want to see the php code...


All times are GMT -5. The time now is 04:58 AM.