[wp-hackers] How to install a new theme?

Nikola Nikolov nikolov.tmw at gmail.com
Mon Feb 24 19:12:49 UTC 2014


Hi Steve,

I don't think that the problem should be that you are behind a firewall -
after all you're accessing localhost at 127.0.0.1 so I don't think that the
firewall should matter.

The problem with WordPress asking for FTP credentials is that the
permissions for wp-content do not allow it to write files and directories.
That means that if WordPress(read PHP) is run as the www-data user then the
permissions that would allow it read/write access to the wp-content
directory are 0755. From a terminal you can run the following commands(omit
the "sudo" part if you are logged-in as root):

cd /var/www/blog/
sudo chmod 0755 wp-content/
cd wp-content/
sudo find -type f -exec chmod 0644 {} \;
sudo find -type d -exec chmod 0755 {} \;

What the above would do is to change the permissions on the wp-content
folder to ones that allow WordPress read/write access to it. After that we
would give write access to all files and directories within wp-content -
you don't have to do that, but if you want to be able to use the
theme/plugin editor you need to do so.

After you do that, open Files(the file manager of Ubuntu 13.10), go to
/var/www/blog/wp-content/themes/ and manually delete the theme folder. Then
you should be able to install the theme through WordPress(which will
automatically give it the right permissions and ownership).

If you're only going to use the installation for development purposes, you
can do what I tend to do:
 - Change the group to which of all files and directories belong to a group
that my current user belongs to(usually the same as the username).
Alternatively you can just add your user to the www-data group.
 - Change the permissions of all directories to 0775 and the permissions of
all files to 0664.

This allows me to change files via a text editor and allows WordPress to
write all of the files that it wants to.


On Mon, Feb 24, 2014 at 9:06 PM, John Blackbourn
<johnbillion+wp at gmail.com>wrote:

> Hi Steve,
>
> After unzipping the theme into "ryu", is there an "ryu" directory
> inside it? If so you'll need to move the files inside it up one level.
>
> Eg. this is wrong:
>
> ryu
>  - ryu
>     - index.php
>     - style.css
>
> This is right:
>
> ryu
>  - index.php
>  - style.css
>
> If that's not the problem then I've no idea what's wrong. Installing a
> theme is very straight forward. The only other thing it could be is an
> opcode cache, but that should get flushed when restarting the server
> or the machine.
>
> John
>
> On 24 February 2014 18:59, Steve Litt <slitt at troubleshooters.com> wrote:
> > Hi all,
> >
> > I'm running WordPress on Ubuntu 13.10, installed via Ubuntu's normal
> > package. From http://127.0.0.1/blog/wp-admin/themes.php , I go to the
> > Install Themes tab, search for ryu, click "Install Now", and I get "To
> > perform the requested action, WordPress needs to access your web
> > server. Please enter your FTP credentials"
> >
> > I'd rather not give someone FTP or sftp access, and besides, I'm behind
> > a firewall, but no problem: I just downloaded ryu myself, unzipped it
> > into /usr/share/wordpress/wp-content/themes/ryu in exactly the same way
> > as the
> > preexisting /usr/share/wordpress/wp-content/themes/twentythirteen, but
> > when I went to WordPress, ryu wasn't shown as an installed theme. No
> > problem, I logged out and back into Wordpress, same problem. I stopped
> > and started Apache: Same problem. I rebooted the computer. Same problem.
> >
> > Twentytwelve is installed too. I think I installed it yesterday without
> > these problems, but I'm not sure. Anyway, I grepped the
> > entire /usr/share/wordpress tree for "twentytwelve" and, other than the
> > files inside the theme itself, I came up with the following files:
> >
> > * wp-admin/includes/update-core.php
> > * wp-content/languages/*.mo
> > * wp-includes/class-wp-theme.php
> >
> > At that point I decided to quit experimenting and ask for help. Ideally
> > I'd like to be able to install a new theme *both* the automatic way
> > from my WordPress site (but without giving WP an (s)ftp login), and by
> > downloading the theme .zip and incorporating it into my installation.
> >
> > I read on the Internet various descriptions of the "ftp credentials"
> > problem as being a permissions problem or something you fix with chown,
> > but all these posts conflicted with each other in the details so I
> > decided to ask here. For all I know it's just because my Ubuntu machine
> > is behind a firewall.
> >
> > Thanks,
> >
> > Steve
> >
> > Steve Litt                *  http://www.troubleshooters.com/
> > Troubleshooting Training  *  Human Performance
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list