Subdomain permission problem with upload

Mr.Novo

Member
Apr 9, 2017
11
1
3
Istanbul
cPanel Access Level
Root Administrator
Hi,

I'm receiving write error while uploading simple file to php application running under a subdomain. There is no error with php script while using domain.com/subdomain but throwing write permission error at subdomain.domain.com

Also downloaded files via curl owned with nobody instead of account user
 

Mr.Novo

Member
Apr 9, 2017
11
1
3
Istanbul
cPanel Access Level
Root Administrator
Hi,

Simple php upload script runs under a subdomain like up.domain.com throws permission denied error when target folder is chmod 755

Warning: move_uploaded_file(uploads/1530201017.jpg): failed to open stream: Permission denied in /home/wp4/public_html/imgupload/index.php on line 28

Warning: move_uploaded_file(): Unable to move '/tmp/phpcjiNRR' to 'uploads/1530201017.jpg' in /home/wp4/public_html/imgupload/index.phpon line 28


Its fine when working under domain.com/up

If i change folder to 777 and try to upload from up.domain.com, uploded file is owned by "nobody".