php - cant mkdir on new server, unsure why -


i have switched website hosted on normal webhost linode virtual server installed of appropriate bits , pieces to. moved code on , in complex web-application works except image uploader - failing create new folders.

i have gone ahead , placed in code debug

$uid = "blahblahblah"; $thisdir = getcwd() . "/" . $uid . "/";   if(mkdir($thisdir , 0777))  {     echo "directory has been created successfully...";  }  else  {     echo "failed create directory...";     echo " dir variable is:'" . $thisdir . "'" ; }  

which outputting

failed create directory... dir variable is:'/home/jhstaffo/public/firstclassresearch.com/public/shopper/blahblahblah/' 

why happening - server setting or wrong code? going on?

it appears accurate way deal in ubuntu server assuming apache running using user www-data - functions appropriately

chown -r www-data:www-data /home/jhstaffo/public/firstclassresearch.com/public 

Comments