Skip to content
Advertisement

Create Checkout Session.php 404 not found

JavaScript

I have downloaded the above code from here https://stripe.com/docs/checkout/integration-builder and put the file in my Xampp folder under htdocs, so whenever I am running http://localhost/my-projects/stripe-payments-prebuilt/checkout.html so it is showing me the checkout the page but when I clicked on the checkout button then it is showing “checkout.html:30 POST http://localhost/create-checkout-session.php 404 (Not Found)” I mean what I have done wrong, I can run other projects so it means there is no server issue, so what can be the issue?

Advertisement

Answer

First of all, there is a 404 error because the file was never there. In localhost or all servers, if you put a / before the file name it will automatically become after the host so /config.php will become http://localhost/config.php. To prevent this error, you should use ./

And the unexpected token < means the server is returning the 404 document.

In short, put a dot before the file name as I am assuming that this project is not in the root directory. (Means that the project is at http://localhost/projectName)

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement