Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Evanz's avatar
Level 1

Lumen api not working consistently.

I am using Lumen 7.7.2 for my api. I have enabled cors using this tutorial https://github.com/digiaonline/lumen-cors, but in my Ionic application the cors error disappears, however sometimes the api works well and returns the expected results and sometimes my ionic app returns this error "Failed to load resource: net::ERR_ADDRESS_UNREACHABLE". I tried connecting the ionic app to other lumen api's that I have on localhost and it works well with them all the time without any errors. Is there a specific way am supposed to enable cors in lumen?

0 likes
3 replies
PaulMaxOS's avatar
Level 8

Well, could be lots of different reasons, but to me the first thing that pops up is your internet connection maybe being disrupted from time to time.

Have you tested it using different internet connections, like mobile vs wifi?

If it's only on wifi, you may want to reset your router and give it try again.

1 like
Evanz's avatar
Level 1

You are right about the internet connection. My wifi keeps going on and off, and I think this could be the problem.

1 like
PaulMaxOS's avatar

Then you might want to mark that as solved, so others know that this was the issue and that it has nothing to do with CORS

1 like

Please or to participate in this conversation.