Support » Fixing WordPress » Where is wp-json?

  • On a fresh install of WordPress 5.2.4 (which I’ve tried twice), whenever I try to create a new page I get a ‘Publishing failed’ error and the following in the logs

    2019/10/22 11:44:36 [error] 21135#21135: *130 open() “/var/www/” failed (2: No such file or directory), client: 2a02:8010:d004:0:b4f8:e0a1:9da9:db6f, server:, request: “POST /wp-json/wp/v2/pages/54/autosaves?_locale=user HTTP/2.0”, host: “”, referrer: “”

    There’s no wp-json directory in the download (tried it twice) so I don’t know if I’m supposed to create it or what. I read somewhere about pretty permalinks needing to be set and I’ve done this.

    Thanks for looking

Viewing 13 replies - 1 through 13 (of 13 total)
  • wp-json is the REST API for your site. It is a virtual address.
    Do you have a plugin that disables the REST API? Are you trying to edit a custom post type that does not specify the REST API use?
    You can take a look at Tools > Site Health to see what it says about the way your site is configured.

    Thread Starter tricericci


    This is a clean WP install, the only plugin I have running is Akismet. All I’m doing is trying to create a new page on my blog

    Thread Starter tricericci


    After checking Tools > Site health, an optional PHP module is missing and the REST API gave a 404 error.

    Weirdly though, I’ve lost the configuration lines in wp-config.php which enable multiple blogs (I REALLY don’t know how that happened). Going to tear the whole thing down and start from scratch again, I’ll repost an update (probably in a few days)

    Thread Starter tricericci


    Clean install with clean database, cleared up a few minor issues under Tools > Site health, but REST API still gives 404 Not Found error

    Please try changing your parmalink to “Post Name”. WP Rest API doesn’t play well with “Custom Structure” 🙂

    I’ve got same error.
    Publishing failed. Error message: The response is not a valid JSON response.

    my permalin is on post name.

    also this error:
    wp-json No such file or directory

    any update on this issue?

    where is wp-json ?

    If your website does not use pretty printing wp-json will not be the correct url. You will know if your site uses pretty printing because the links will be instead of

    If is not returning JSON data try If you are at a real loss then get the output of `get_rest_url to find the REST url

    I had the same problem today morning. After reading here the .htaccess relation, I just updated a not-so-old .htaccess file and the problem was solved.

    I just had this problem. My symptom was that no permalinks worked. The fix was to alter the Apache config for the directory, adding:

    AcceptPathInfo on

    I think you can add it to .htaccess, but I added it to the server’s config.

    If this is on, then URLs like /index.php/path/to-page/ will work. Apache will look for a path to a file that exists, and then pass the URL to that file.

    My secondary problem was that my .htaccess wasn’t being read at all, because options were not enabled. At this time, I’m using .htaccess, but it would be more efficient to move these up into the server config, so you avoid reading an extra file.

    • This reply was modified 1 year, 4 months ago by johnkawakami.

    Genral URL issues raises from:
    in host
    1. root directory of wordpress missing .htaccess file
    2. wrong php version
    3. missing php extensions

    in wp
    1. permalinks “must” be changed from default to post name (or custom)
    2. missmatching wordpress config website-url and server website domain

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Where is wp-json?’ is closed to new replies.