Webserver user read and write permissions errors ==== OS fedora

i have a folder i have created in /var/www/ called uploads in my serve(fedora) .....this folder i want to put my uploaded content from my web service ....... i have done the following: su chown githinji/var/www/uploads but i keep getting the following error when trying to upload content to the server Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46 Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song gosh any ideas , thanks -- http://xkcd.com/154/

change the folder permission to 0777 2009/9/17 I. Ati <mueni0@gmail.com>
i have a folder i have created in
/var/www/
called uploads
in my serve(fedora) .....this folder i want to put my uploaded content from my web service .......
i have done the following: su
chown githinji/var/www/uploads
but i keep getting the following error when trying to upload content to the server
Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46
Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song
gosh any ideas ,
thanks
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

On Thu, Sep 17, 2009 at 1:27 PM, I. Ati <mueni0@gmail.com> wrote:
i have a folder i have created in
/var/www/
called uploads
in my serve(fedora) .....this folder i want to put my uploaded content from my web service .......
i have done the following: su
chown githinji/var/www/uploads
This command did not complete with 0 status exit code as you need a space there, so something like: chown githinji [space] /var/www/uploads
but i keep getting the following error when trying to upload content to the server
Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46
Looks to me like the issue is actually about the permissions on /var/www/html/.. and not /var/www/uploads unless the two are symlinks.
Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song
My suggestion to you, if acceptable, is to run an FTP server which chroot()s the users to their designated upload directory and let them upload via FTP. -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "If you have nothing good to say about someone, just shut up!." -- Lucky Dube

changing perms to 0777 is a bad idea, just give the ownership of the folder to the user running apache, assuming u r using apache as the web server chown apache.apache /var/www/upload chmod -R 755 /var/www/upload Regards On Thu, Sep 17, 2009 at 1:45 PM, Odhiambo Washington <odhiambo@gmail.com>wrote:
On Thu, Sep 17, 2009 at 1:27 PM, I. Ati <mueni0@gmail.com> wrote:
i have a folder i have created in
/var/www/
called uploads
in my serve(fedora) .....this folder i want to put my uploaded content from my web service .......
i have done the following: su
chown githinji/var/www/uploads
This command did not complete with 0 status exit code as you need a space there, so something like:
chown githinji [space] /var/www/uploads
but i keep getting the following error when trying to upload content to the server
Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46
Looks to me like the issue is actually about the permissions on /var/www/html/.. and not /var/www/uploads unless the two are symlinks.
Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song
My suggestion to you, if acceptable, is to run an FTP server which chroot()s the users to their designated upload directory and let them upload via FTP.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "If you have nothing good to say about someone, just shut up!." -- Lucky Dube
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

yeah am using apache @chris On Thu, Sep 17, 2009 at 1:53 PM, Chris Mwirigi <mwirigic@gmail.com> wrote:
changing perms to 0777 is a bad idea, just give the ownership of the folder to the user running apache, assuming u r using apache as the web server
chown apache.apache /var/www/upload chmod -R 755 /var/www/upload
Regards
On Thu, Sep 17, 2009 at 1:45 PM, Odhiambo Washington <odhiambo@gmail.com>wrote:
On Thu, Sep 17, 2009 at 1:27 PM, I. Ati <mueni0@gmail.com> wrote:
i have a folder i have created in
/var/www/
called uploads
in my serve(fedora) .....this folder i want to put my uploaded content from my web service .......
i have done the following: su
chown githinji/var/www/uploads
This command did not complete with 0 status exit code as you need a space there, so something like:
chown githinji [space] /var/www/uploads
but i keep getting the following error when trying to upload content to the server
Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46
Looks to me like the issue is actually about the permissions on /var/www/html/.. and not /var/www/uploads unless the two are symlinks.
Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song
My suggestion to you, if acceptable, is to run an FTP server which chroot()s the users to their designated upload directory and let them upload via FTP.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "If you have nothing good to say about someone, just shut up!." -- Lucky Dube
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general

Go with Chris option. You see if u look at its operation mode it is not you uploading but apache hence it has to have the right permissions. Cheers Themburu On Thu, Sep 17, 2009 at 2:13 PM, I. Ati <mueni0@gmail.com> wrote:
yeah am using apache @chris
On Thu, Sep 17, 2009 at 1:53 PM, Chris Mwirigi <mwirigic@gmail.com> wrote:
changing perms to 0777 is a bad idea, just give the ownership of the folder to the user running apache, assuming u r using apache as the web server
chown apache.apache /var/www/upload chmod -R 755 /var/www/upload
Regards
On Thu, Sep 17, 2009 at 1:45 PM, Odhiambo Washington <odhiambo@gmail.com>wrote:
On Thu, Sep 17, 2009 at 1:27 PM, I. Ati <mueni0@gmail.com> wrote:
i have a folder i have created in
/var/www/
called uploads
in my serve(fedora) .....this folder i want to put my uploaded content from my web service .......
i have done the following: su
chown githinji/var/www/uploads
This command did not complete with 0 status exit code as you need a space there, so something like:
chown githinji [space] /var/www/uploads
but i keep getting the following error when trying to upload content to the server
Warning: move_uploaded_file(/var/www/uploads/song_1253182839.PNG) [ function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: failed to open stream: Permission denied in /var/www/html/tes/jamms6/library/Music.php on line 46
Looks to me like the issue is actually about the permissions on /var/www/html/.. and not /var/www/uploads unless the two are symlinks.
Warning: move_uploaded_file() [function.move-uploaded-file<http://212.213.221.135/tes/jamms6/function.move-uploaded-file>]: Unable to move '/tmp/phpNwzvTj' to '/var/www/uploads/song_1253182839.PNG' in /var/www/html/tes/jamms6/library/Music.php on line 46 Unable to upload song
My suggestion to you, if acceptable, is to run an FTP server which chroot()s the users to their designated upload directory and let them upload via FTP.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "If you have nothing good to say about someone, just shut up!." -- Lucky Dube
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
-- Conservatism is the adherence to the old tried against the new untried.

Hi, On Thu, Sep 17, 2009 at 3:20 PM, George Njoroge <themburu@gmail.com> wrote:
Go with Chris option. You see if u look at its operation mode it is not you uploading but apache hence it has to have the right permissions.
Likely answer... selinux - Check your selinux logs to confirm Solutions in order (best-worst) - label your upload directory correctly - ls -Z and chcon - Disable selinux temporarily - getenforce and setenforce - Disable selinux permanently - edit grub.conf/menu.lst to add appropriate switch
On Thu, Sep 17, 2009 at 1:53 PM, Chris Mwirigi <mwirigic@gmail.com>wrote:
chown apache.apache /var/www/upload chmod -R 755 /var/www/upload
Good for testing, bad for production environments. If you do this,
remember to chown/chmod back. Regards, Laban
participants (6)
-
Chris Mwirigi
-
George Njoroge
-
I. Ati
-
Jared Koyier
-
Lmwangi
-
Odhiambo Washington