Support » Developing with WordPress » REST API on Manjaro Arch Linux Localhost

  • Resolved petj

    (@petj)


    Hi

    On an Arch Linux Manjaro distro I have set up WordPress. But I cannot use the REST API. I get “error 404”.

    I guess it’s some Linux distribution related problem, since the REST API works like a charm on Mac and Ubuntu.

    • Linux hugin 4.14.39-1-MANJARO #1 SMP PREEMPT Wed May 2 19:03:39 UTC 2018 x86_64 GNU/Linux
    • PHP 7.2.5 (cli) (built: Apr 24 2018 18:12:24) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    • mysql Ver 15.1 Distrib 10.1.32-MariaDB, for Linux (x86_64) using readline 5.1

    NB: the link points to a blog with a screendump from my localhost.

    • This topic was modified 11 months, 1 week ago by  petj.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you have “pretty” permalinks of some sort enabled? There’s actually no file to find. The lack of a found file is what gets requests routed to WP. The rules for this are only in place with pretty permalinks.

    If that’s not it, there’s still something wrong with the .htaccess rules (assuming Apache server) that sends requests to WP.

    Thanx for your kind answer and suggestions.

    I have tried to activate “pretty” permalinks (once more), but with the result that the links don’t work any more.

    Somewhere I saw that mod_rewrite shold be installed, and found it on AUR.

    Still the 404 error. And no luck with the REST endpoints too.

    I tried to edit the .htacces to:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    After a restart … same problem.

    I am tempted to install a Debian or even Ubuntu LAMP on Virtualbox – or similar.

    Normally setting up a LAMP server is a straight foreward process. Perhaps the Arch LAMP server is buggy?

    • This reply was modified 11 months, 1 week ago by  petj.
    Moderator bcworkz

    (@bcworkz)

    Or maybe configured strangely? Check your httpd.conf or apache2.conf configuration files. It’s possible to disable .htaccess overrides through this file.

    Or have you confirmed other .htaccess rules are working?

    If you are not devoted to a particular distro, Debian would be a good choice, but any distro should work with Apache. You do need mod_rewrite obviously. Did you remember to restart Apache after enabling mod_rewrite?

    Just found a solution with a little help from a fellow lecturer (Kenneth Clausen). He found this Apache documentation link.

    I had to set AllowOverride and AllowOverrideList in Apache. After a server restart things began to work.

    Then I followed the .htaccess suggestions from bcworkz about the permalinks. And now the REST API works like a charm on my localhost. Thanx for your suggestions!

    WordPress was not allowed to write in the ../wordpress/ folder, so the .htaccess had to be created manually in nano. So now I mark the problem as solved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘REST API on Manjaro Arch Linux Localhost’ is closed to new replies.