[AWS] Wordpress How to deal with "The response is not a correct JSON response"

phenomenon

I made Wordpress on an Amazon Linux instance. At that time, I changed the permalink from basic to post name and tried to post the article, but I got an error saying "The response is not the correct JSON response" and I could not post & I could not display anything other than the top page. スクリーンショット 2020-07-09 10.48.58.png

The wordpress response is not the correct JSON response In the above article, I found that the apache setting was the cause.

sudo vi /etc/apache2/apache2.conf

As mentioned in the article, I tried to enter the configuration file with the above command, but there was no such file on Amazon Linux. This is because Amazon Linux is based on RedHat, while the above is a Debian configuration file.

reference http://www.linux.net-japan.info/install08.html https://www.acrovision.jp/service/aws/?p=653

approach

There was a method in the AWS documentation. To enable WordPress to use permalinks

  1. After connecting to the corresponding instance, enter the file with the following command.
sudo vim /etc/httpd/conf/httpd.conf
  1. Find the section that starts with <Directory" / var / www / html ">. (* Be careful not to make a mistake because there are multiple AllowOverride lines. Be sure to look for the line in the <Directory" / var / www / html "> section. Search for / html in vim to find it immediately.)
<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
  1. Change the above section to ʻAllowOverride None line to ʻAllowOverride All. (None → All)

  2. Save the file with: wq.

  3. To reflect the above settings, restart with sudo systemctl restart httpd.service. Check if it is active just in case with sudo systemctl status httpd.service.

With the above settings, you can post articles and refer to pages other than the top page, even if the permalink is not basic.

Recommended Posts

[AWS] Wordpress How to deal with "The response is not a correct JSON response"
A story about how to deal with the CORS problem
[VLC] How to deal with the problem that it is not in the foreground during playback
[AWS] How to deal with WordPress "An error occurred when cropping an image."
How to create a submenu with the [Blender] plugin
How to deal with Django's Template Does Not Exist
[Python] How to deal with the is instance error "is instance () arg 2 must be a type or tuple of types"
[systemd] How to deal with the problem that fancontrol does not work after suspending
[AWS] How to deal with "Invalid codepoint" error in CloudSearch
How to deal with imbalanced data
How to deal with imbalanced data
How to deal with DistributionNotFound errors
How to not escape Japanese when dealing with json in python
[Introduction to Python] How to split a character string with the split function
How easy is it to synthesize a drug on the market?
How to make a command to read the configuration file with pyramid
How to send a request to the DMM (FANZA) API with python
How to create a serverless machine learning API with AWS Lambda
How to deal with the problem that the current directory moves when Python is executed from Atom
[PostgreSQL] How to grant superuser authority when the user (role) with superuser authority is 0
[Python] What is a formal argument? How to set the initial value
Think about how to write a filter with the Shotgun API-Contact Versions
How to add a package with PyCharm
[Python] Explains how to use the range function with a concrete example
[Introduction to Python] How to sort the contents of a list efficiently with list sort
How to deal with enum compatibility errors
How to deal with the problem that build fails when CI / CD of Python Function with AWS Amplify
How to fix the initial population with a genetic algorithm using DEAP
[Introduction to Python] How to write a character string with the format function
[Python] How to deal with module errors
How to deal with garbled characters in json of Django REST Framework
Summary of how to build a LAMP + Wordpress environment with Sakura VPS
How to deal with the problem that Japanese characters are garbled when outputting logs using JSON log formatter
How to deal with "^ [[A ^ [[B ^ [[C ^ [[D"] when you press the arrow keys when executing python on mac
How to publish a blog on Amazon S3 with the static Blog engine'Pelican'for Pythonista
How to deal with the inability to open the lock file / var / lib / dpkg / lock-frontend
How to get a list of files in the same directory with python
[Introduction to Python] How to get the index of data with a for statement
How to calculate the volatility of a brand
How to read a CSV file with Python 2/3
How to send a message to LINE with curl
How to deal with errors when hitting pip ②
How to specify the NIC to scan with amazon-dash
How to draw a 2-axis graph with pyplot
How to delete log with Docker, not to collect log
How to develop a cart app with Django
How to add arbitrary headers to response with FastAPI
How to create a JSON file in Python
How to make a dictionary with a hierarchical structure.
can't pickle annoy. How to deal with Annoy objects
How to try the friends-of-friends algorithm with pyfof
How to deal with run-time errors in subprocess.call
How to deal with SessionNotCreatedException when using Selenium
Save the object to a file with pickle
How to create a multi-platform app with kivy
AWS Step Functions to learn with a sample
How to Learn Kaldi with the JUST Corpus
How to set a shared folder with the host OS in CentOS7 on VirtualBOX
How to use a library that is not originally included in Google App Engine
How to identify the element with the smallest number of characters in a Python list?
How to check in Python if one of the elements of a list is in another list