I'm developing an image uploader script using php 5.3 Website is under shared linux hosting, everything seems to works fine, except that I can't move uploaded images to destination folders.
Warning: move_uploaded_file(images/2014091546_screen.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/user/public_html/upload.php on line 68
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpJwnzVo' to 'images/2014091546_screen.jpg' in /home/user/public_html/upload.php on line 68
I've tried to chown folder to 'nobody' user but it fires another error
The only thing thats helps is chmod folder to 0777, but it's a serious security hole, so that's not a solution. I've tried to chmod dynamically destination folder using the script to set first 0777 and revert to 0755 once the image is on place, but seems that PHP have no rights to do that.
Due to hosting limitation, I have no terminal or shell access, so there is no command line options to use.
Is there a solution in PHP to achieve that?
Thanks in advance.
Warning: mkdir() [function.mkdir]: Permission denied in /home/user/public_html/backend/upload.php on line 67PHP user is "nobody" - Farid Silva Aboid