php - move_uploaded_file() gives a Owner/Group error -
i'm using move_uploaded_file() upload images server, gives usual error of:
warning: move_uploaded_file(upload/file.png) [function.move-uploaded-file]: failed open stream: no such file or directory in /home/newuser/public_html/model/account.class.php on line 39 warning: move_uploaded_file() [function.move-uploaded-file]: unable move '/tmp/phpulkuge' 'upload/file.png' in /home/newuser/public_html/model/account.class.php on line 39 this not permission based have set folder 777 root access , ls -l displays correctly this.
755 /home/newuser/public_html/model 755 /home/newuser/public_html/model/account.class.php 777 /home/newuser/public_html/upload php line
move_uploaded_file($_files["photo"]["tmp_name"], "../upload/file.png"); the problem think down owner/group setting being configured incorrectly .. while had of sites subdomains in 1 account:
/home/olduser/public_html/subdomains/index.html i changed , created new user account manage separate website easier , moved files across ...
/home/olduser/public_html/subdomains /home/newuser/public_html/index.html the new folders in /home/newuser owned , grouped newuser newuser think php may running nobody olduser causing issue?
what can try fix this?
permissions particular file / directory don't apply on directory itself, on whole path leading it.
example:
/home/ - needs 'x' permission (execute) /home/newuser/ - needs 'x' permission /home/newuser/public_html/ - needs 'x' permission /home/newuser/public_html/avatar/ - needs 'wx' permission (execute + write)
Comments
Post a Comment