The HTTP response status code 405 (Method Not Allowed) indicates that the request method is known by the server, but not supported by the target resource.

Check your script if the requested URL listens to that specific request method and make sure that your web server is configured correctly.