I'm trying to install Wordpress using the following installations. However, when I attempt to open the browser to set up Wordpress, I get an error that there is a problem establishing a database connection. I think it's because of an error I get when I run the chown
command.
http://www.techkaki.com/2011/04/how-to-install-wordpress-locally-on-ubuntu-10-10-with-lamp/
chown -R www-data /var/www/wordpress
I get a ton of error messages:
...
chown: changing ownership of `/var/www/wordpress/wp-admin/network/themes.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/users.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/index.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/sites.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/user-new.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/setup.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/theme-install.php': Operation not permitted
chown: changing ownership of `/var/www/wordpress/wp-admin/network/plugins.php': Operation not permitted
Anyone know what's up with this?
You have to be root to change the owner of files/directories.
If you're getting an error like Operation not permitted, just type:
at the prompt to execute the last command with root priviledges. This way, you don't have to retype
chown -R www-data /var/www/wordpress
.If you're not root, you'll need to become root to set these permissions:
Besides being root, as others have pointed out, there is another more flexibile way to manage this privilige. You can also give files away via chown if your process / thread has the CAP_CHOWN Posix capability. For more info, and how to get that capability, see http://manpages.ubuntu.com/manpages/intrepid/man7/capabilities.7.html Unfortunately it doesn't yet seem to be possible for a process to gain specific capabilities like this based on attributes of an executable file. Either the process would have to be configured this way by another privileged process, or the executable would have to be fully setuid, and then give itself the capability before dropping root priviliges as a normal safety precaution.
A tip of the hat to Can't change owner (user or group) of directory which I have all rights on? - Super User