skip to Main Content

I think I’m going crazy.
I’ve tried all the problems I’ve seen on the internet but I can’t solve them.
I installed wordpress but I can’t make any changes to any page. It’s like wordpress can’t access the server files.
REST API gives this error:

The REST API encountered an error
Performance
The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.

When testing the REST API, an error was encountered:

REST API Endpoint: https://borasozer.com/wp-json/wp/v2/types/post?context=edit
REST API Response: (http_request_failed) stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000410:SSL routines::sslv3 alert handshake failure stream_socket_client(): Failed to enable crypto stream_socket_client(): Unable to connect to ssl://borasozer.com:443 (Unknown error)

I also get this error when I make changes to the page and try to update it:

Updating failed. The response is not a valid JSON response.

Even if I changed the permission of all WordPress files to 777, it did not change. I may have made a mistake in the HTTPS change when setting SSL, but I couldn’t solve it.

I tried the solutions related to .htaccess but I couldn’t get out of it. Saving the Permalink section again and again did not create a solution. I guess it can’t write to .htacces in any way.
Also, even though my pages have permalinks, none of them appear on the website except the homepage. I cannot change the main page nor the others.

Can someone help me, thanks…

2

Answers


  1. First of all run the following command to install PHP dependencies required to run the WordPress properly. It’ll solve many errors.

    sudo apt install php-curl php-imagick php-mbstring php-zip php-intl
    

    Follow the following steps one by one:

    1. change your directory

      cd /etc/apache2/sites-available
      There are two files here you have to edit.
      First File: your_website.com.conf (replace your_website.com with the your file name)
      (Make sure you have the following lines just below the DocumentRoot line. If not please add them)

      <Directory /var/www/html/wordpress>
          Options Indexes FollowSymLinks
          AllowOverride All
          Require all granted
      </Directory>
      

    Note: The line after the word directory should be same as the line after DocumentRoot

    Second File:your_website.com-le-ssl.conf
    (Make sure you have the following lines just below the DocumentRoot line. If not please add them)

    <Directory "/var/www/my-website-name.com/public_html">
        # this allows .htaccess files (e.g. generated by WordPress)
        # to overwrite the apache configuration on a directory basis:
        AllowOverride All
    </Directory>
    

    Note: The line after the word directory should be same as the line after DocumentRoot

    1. Execute the following commands to re-enable the edited files

      sudo a2ensite your_website.com.conf
      sudo a2ensite your_website.com-le-ssl.conf

    2. Execute the following commands to restart apache service

      sudo systemctl restart apache2

    There you go! It should solve your this error completely now.

    Login or Signup to reply.
  2. Not working and my server is litespeed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search