• I’m running WordPress on a Vagrant box – specifically Ubuntu 14.04 LTS (Trusty 64).

    When I run this virtual machine on my Windows host, everything works just fine.

    When I run it on my Mac, WordPress asks me for FTP details each time I ask it to do something with the filesystem, i.e. remove a theme.

    I expect it’s something to do with file permissions, but I’m struggling to figure out exactly what. WordPress is running in the virtual machine and I can’t understand why the file permissions would be any different by host.

    On the virtual machine itself, I’ve recursively set all permissions to 777 (extreme I know, but just to prove the point). I’ve also done that on my host for the shared folder just in case. Still no result though.

    Does anyone have any other ideas as to what might be causing WordPress to ask for these details?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kingstonrichard

    (@kingstonrichard)

    OK, so an update for anyone else struggling with this problem, I’ve launched clean versions of the vagrant box on both my Windows host and my Ubuntu host. So to recap, this is the same Ubuntu box running virtually on 2 different hosts.

    Using vagrant ssh I’ve connected into each box and with cmd/terminal I’ve traversed to the themes directory and run ls -alh and to my surprise noted different permission levels:

    From the Windows host (which doesn’t ask for FTP permissions):

    drwxrwxrwx 1 vagrant vagrant 0 Jul 22 09:47 .
    drwxrwxrwx 1 vagrant vagrant 0 Jul 22 09:47 ..
    -rwxrwxrwx 1 vagrant vagrant 30 Jul 22 08:19 index.php
    drwxrwxrwx 1 vagrant vagrant 0 May 8 17:45 twentyfourtee
    drwxrwxrwx 1 vagrant vagrant 0 May 8 17:45 twentytwelve

    From the Mac host (which does ask for FTP permissions):

    drwxr-xr-x 1 vagrant vagrant 0 Jul 22 09:47 .
    drwxr-xr-x 1 vagrant vagrant 0 Jul 22 09:47 ..
    -rw-r–r– 1 vagrant vagrant 30 Jul 22 08:19 index.php
    drwxr-xr-x 1 vagrant vagrant 0 May 8 17:45 twentyfourtee
    drwxr-xr-x 1 vagrant vagrant 0 May 8 17:45 twentytwelve

    So, it looks like the Mac instance of the box is missing some write permissions on files (and folders?) – actually this goes all the way up the tree structure to the WordPress root.

    Thread Starter kingstonrichard

    (@kingstonrichard)

    So, the final result was to effectively reset all directory and file permissions back to the WordPress defaults as part of the Vagrant provisioning script.

    codex.wordpress.org/changing_file_permissions contains more detail but I used these 2 commands:

    chmod 755 $(find /DIR -type d)
    chmod 644 $(find /DIR -type f)

    Hope it helps someone else out.

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Asking for FTP details when removing themes’ is closed to new replies.