Have you pushed the code to github as @froschdesign requested in your other topic? The issue has to be in the project itself due to /api/ping being a default route when building from the skeleton. If the suggestions in your other topic does not resolve the issue then we really need to be able to see all of your configuration to know what has happened to break it.
Edit to add:
When you say 404 error… How is this presented? Via the Whoops handler, is any other information provided other than 404?
Yes, the code is on Github - GitHub - sanjivsharmalv/mezzio: LoginHandler - Not Found Issue
As far as Whops is concerned, I am not sure how is error published. It is just displayed as ‘Not Found’ and and it doesn’t come from any of templates(error or 404 of layout dir).
The development status should be either enabled or disabled. So, I am taking it that development mode is enabled.
My gut tells me that it’s something server related. Did you test the ping handler before trying to add any other handlers? The ping handler should absolutely work before any changes have been made. If it does not then it’s most likely a incorrectly configured vhost.
Are you running this in a subdirectory of the initial vhost in MAMP? If so that could very well be the issue. By default Mezzio expects to live in the root with the entry file (index.php) and htaccess living in the docroot which should be /public.
If it turns out that you are running in a sub directory please see this documentation:
Did you test the ping handler before trying to add any other handlers?
<<Now, since LoginHandler is already added, I removed it and then tested /api/ping, it did not work.
Are you running this in a subdirectory of the initial vhost in MAMP?
<<My vhost entry:
<VirtualHost *:8888>
ServerAdmin mezzio
DocumentRoot “/Users/sanjivsharma/mezzio/public”
ServerName mezzio.test
ServerAlias mezzio.test
ErrorLog “logs/mezzioerror_log”
CustomLog “logs/mezzioaccess_log” common
Thanks!
I assume you pulled down this repository code and tried to produce the issue at you end. if yes, please share your findings.
Not sure about your entire server setup, but you do not have AllowOverride All present so I am not sure if your htaccess file is having any effect there. You should look into how you enable it for MAMP. It’s been years since I used MAMP.
Also, if you are running a fresh install of mezzio then I really do not need to pull it since /api/ping should absolutely work as long as you have not made any changes and your dev server is correctly configured.