Publishing error. The response is not a valid JSON response.

All MAMP discussions around troubleshooting and anything related to MAMP. Be as detailed as possible here when posting an issue.
Post Reply
ilyazh
Posts: 5
Joined: Tue Jul 06, 2021 5:32 pm

Publishing error. The response is not a valid JSON response.

Post by ilyazh »

Hello!

I'm working with WordPress and try to launch new site in localserver/wordpress with Mamp and Mamp Pro.

But i can't.

So mistakes - Publishing error. The response is not a valid JSON response.

I can't publish and save my notes/pages/etc.

How can I fix it?

Also:

How can i check if mod_rewrite is loaded in my local Apache?

and also whether mod_rewrite directives are allowed in .htaccess ?
in the global httpd.conf should be for the site folder AllowOverride All - how to do it?

Thanks in advance.
aurovrata
Posts: 1
Joined: Mon Jun 30, 2025 3:36 pm

Re: Publishing error. The response is not a valid JSON response.

Post by aurovrata »

This post is quite old, but since I could not find any solutions to the same problem, I am posting my answer here for others to find...

I believe the above issue (as titled in this post), is related to the wp-json URL returning 404 server errors.

A quick test is to open the following URL in your broswer: http://localhost:8080/wp/wp-json/wp/v2

If you get a "URL not found" error then try the following:

Go to your MAMP installation configuration file (mine is on a mac, so Applications->MAMP->conf->apache->httpd.conf and edit this file.

Search for "LoadModule rewrite_module", and likely it is commented as is,

Code: Select all

#LoadModule rewrite_module modules/mod_rewrite.so
uncomment it,

Code: Select all

LoadModule rewrite_module modules/mod_rewrite.so

save the file and restart your apache server (stop and start the MAMP service) . This should do it.


It's actuallt amazinf that MAMP has this line commented out by default on a localhost installation.
Post Reply