php - Uploads directory is not writable -


i've moved server new host , i'm having problems php upload form. files can not uploaded. error is:

warning: move_uploaded_file(/public_html/site/abc/uploads/aplication.doc) [function.move-uploaded-file]: failed open stream: no such file or directory in /long/path/apply.php on line 389

warning: move_uploaded_file() [function.move-uploaded-file]: unable move '/tmp/phpdaz5qp' '/public_html/site/uploads/1908131216_application.doc' in /long/path/apply.php on line 389 problem: not move file destination directory not writable /tmp/phpdaz5qp - /public_html/site/abc/uploads/1908131216__application.doc

i have little test see if directory writable, , it's not.

$upload_dir = "/public_html/site/$companyfolder/uploads"; if(!is_writable($upload_dir)) {     $writable = 'not writable'; } else {     $writable = 'writable'; } echo $writable; 

i have uploads folder set 777 permissions. ideas of why directory not writable?

from above code, seems upload path incorrect:

$upload_dir = "/public_html/site/$companyfolder/uploads"; 

should have been like:

$upload_dir = "/home/youruser/public_html/site/{$companyfolder}/uploads"; 

the directory needs absolute path or relative. when it's relative, needs relative php being called at.

so have used ./site/{$companyfolder}/uploads example, given php code being used @ /home/youruser/public_html.


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -