0
votes

In my site till previous month i am able to upload images in the post->media now it says some error like

Unable to create directory /var/www/vhosts/modeling.com/httpdocs/wp-content/uploads/2012/03. Is its parent directory writable by the server?

I checked from root folder all forder has a write permission

In coding part

$stat = stat( dirname( $new_file ));
$perms = $stat['mode'] & 0000666; @ chmod( $new_file, $perms );

i am using above to give permission for a newly created folder.Newly created folder also have 777 permission but i am unable to upload images within the folder.I spend more than a day still i am facing the same issue please guide me

2

2 Answers

0
votes

had the same problem couple of weeks back - try turning php's safe_mode off. should work like a charm after that...

0
votes

Very simple solution for this is

Login to your wordpress admin Go to Setting->media You will see the path in a text field with a label "Store uploads in this folder". In your case it will be /var/www/vhosts/modeling.com/httpdocs/wp-content/uploads/ Just remove the slash in the front and make it like var/www/vhosts/modeling.com/httpdocs/wp-content/uploads/

Save the settings and you will be able to upload images.