Skip to content

HTTP error when uploading assets. #11

@filipecatraia

Description

@filipecatraia

This is a silly issue. The fix is a tad obvious. But others might run into this, so I thought I'd share. This happens in macOS with the default configuration, because there's no www-data user by default. For reference, I installed nginx with brew.


When uploading an image, Wordpress shows an HTTP error. The log is:

open() "/usr/local/var/run/nginx/client_body_temp/0000000001" failed (13: Permission denied)

So obviously, the problem is that I started nginx without sudo. (I like it that way.) If I sudo nginx I have the permission to write files to /usr/local/var/run/nginx/, so the upload works.

Even more obvious, the better solution is to start have a proper user for nginx:

# in nginx.conf
user www www;

The above applies to macOS. I'm not sure if in Linux www-data is preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions