Call api in localhost working fine, but when deploy to cpanel return internal error 500

I get this error

  1. code: “ERR_BAD_RESPONSE”
  2. config: {transitional: {…}, adapter: Array(2), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}
  3. message: “Request failed with status code 500”
  4. name: “AxiosError”
  5. request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}
  6. response: {data: {…}, status: 500, statusText: ‘Internal Server Error’, headers: em, config: {…}, …}
  7. stack: "AxiosError: Request failed with status code 500\n at http…
  8. [[Prototype]]: Error

Any logfiles on the live server?
Try asking chatgpt on how to debug it.

Are you sending the correct API key in the header? I’d check that first.

1 Like