Upgrading WordPress automatically – Permissions
When upgrading WordPress automatically there might be some permissions and issue for files that need to be added or overwritten. Below is quick fix to change the permissions on the proper folders and files.
cd /DOMAIN/www/wordpress/
(root WordPress installation directory)
change the permissions on any files
find . -type f -exec chmod 774 {} \;
change the permissions on any folders
find . -type d -exec chmod 775 {} \;
Set the permissions back
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
After doing some more research regarding installing plugins I came across a nice piece of code to allow plugins, updates and themes to be installed without giving the server credentials each time. I see a security issue in both situations. Figure out the best solution for your situation.
Add the following code at the end of your wp-config.php file.
/** Override default file permissions */
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
If you tryed everything and upload in your wordpress still doesn’t work. I have an answer for you. In short: php safe mode won’t let you create files or directories if your php scripts and upload directory belongs to different users. So there are 2 possible solutions: either disable php safemode (not recommended), or change an owner of scripts and upload directory:
cd /DOMAIN/www/wordpress/ (root WordPress installation directory) chown -R nobody:apache *
![[Return to HOME] web design solutions](/images/logo_body.jpg)