• I’m having great trouble working out exactly what WP needs to allow a theme to be installed from within WP itself.

    My web server user is ‘wwwrun’. The permissions on wp-content/uploads, wp-content/upgrade and wp-content/themes allows this user to write.

    Running the command-line ‘wp’ tool to install a theme works: the theme zip file appears in wp-content/uploads/2016/08 and gets unpacked into wp-content/themes:

    wwwrun@login190:~> wp --debug --path=/local/www/htdocs/ theme install philomina
    Debug: No readable global config found (0.016s)
    Debug: No project config found (0.018s)
    Debug: No package autoload found to load. (0.031s)
    Debug: ABSPATH defined: /local/www/htdocs/ (0.031s)
    Debug: Begin WordPress load (0.032s)
    Debug: wp-config.php path: /local/www/htdocs/wp-config.php (0.032s)
    Debug: Loaded WordPress (0.402s)
    Debug: Running command: theme install (0.402s)
    PHP Notice:  Undefined offset: 4 in phar:///usr/local/sbin/wp/php/WP_CLI/DocParser.php on line 124
    Notice: Undefined offset: 4 in phar:///usr/local/sbin/wp/php/WP_CLI/DocParser.php on line 124
    Installing Philomina (1.3.2)
    Downloading install package from https://downloads.wordpress.org/theme/philomina.1.3.2.zip...
    Using cached file '/var/lib/wwwrun/.wp-cli/cache/theme/philomina-1.3.2.zip'...
    Unpacking the package...
    Installing the theme...
    Theme installed successfully.

    However if I try to install a theme from within WP itself (the web server also running as wwwrun) I just get taken to the page that requests FTP credentials. I can see that the zip file appears in wp-content/uploads/2016/08 but it seems that unpacking fails for some reason. No warnings, no errors, just silent failure. Turning on WP debugging doesn’t help.

    What does the theme installer require in terms of permissions that isn’t required by the ‘wp’ utility?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Interms of permission 755 should work, check ownership of the folder to user permmission. also make sure you downloaded the complete zip file correctly , incomplete theme folder can also cause such issue.

    Thread Starter lgretton

    (@lgretton)

    Permissions allow the web server user to write to the folders in question, and as I explained the process works with ‘wp theme install’ as the web server user (therefore proving the permissions are correct), just not from the WP web side.

    If I take the cached zip file that ‘wp theme install’ downloads and attempt to install that via the web installer I get the same failed result, so the zip file integrity is not in question.

    I can’t install a theme from the theme manager either (i.e. not as a zip, this is probably closer to what ‘wp theme install’ would do) – same problem: no error reported, I’m just prompted for FTP credentials.

    So it’s pretty clear that ‘wp theme install’ works a bit differently from the WP web theme installer, presumably the web installer wants to write somewhere other than wp-content for some reason?

    Googling suggests that in the past (if not currently) WP would check the ownership of some of its PHP files and fail if they weren’t the same as the web server user. Certainly if I make the whole WP install belong to the wwwrun user the theme installer will work, but that’s not a desirable solution. I’ll change the ownership of specific files if really necessary but as ‘wp theme install’ works it clearly isn’t necessary.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Theme Installation from zip: permissions’ is closed to new replies.