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.
Publishing error. The response is not a valid JSON response.
Re: Publishing error. The response is not a valid JSON response.
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,
uncomment it,
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.
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
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.