How to allow PHP to overwrite files?

They have: 11 posts

Joined: Jun 2008

i'm running WordPress on my new VPS box and can't get the automatically update plugins feature to work. i asked why in the support forum and someone said it's because PHP on my VPS box doesn't allow file overwrites - http://wordpress.org/support/topic/230573

so my question to you good WMF folk is, how do i enable PHP to overwrite files? also what are the risks involved?

i'm a PHP/Unix newbie but a fast learner. appreciate your help. thanks!

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Ths best way to accomplish this is to install suPHP on your server and make your PHP scripts run as their own user. This gives your scripts full access to your home directory.

The only other option is to chmod your files to 0777 which makes them readable and writable by everyone - probably a bad idea.

They have: 11 posts

Joined: Jun 2008

hi, thanks for answering. i actually have already CHMOD-ed my directory to 777. it seems like it's a different problem. i'll check out suPHP. Thanks!

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Probably should change the directory permissions back to what they where (if you haven't already). Anything that doesn't need full read/write like that should not have it.
'Usually' 644 if you cannot remember

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.