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

mohafiz's avatar

Lumen microservices, service using API gateway's database configurations

Hello, I am developing a microservices app with lumen, I have two services, Auth and Order. The Auth service is where I handle authentication logic, register, login, ...etc. In Order service I have the logic of submitting new order, get the order status, ..etc. And I have an API gateway which is the entry point to the app. The issue is that when I make a request from the API gateway to one of the services, it uses its (the API gateway) database configuration (in the API gateway's .env file). That is, let's say the order service is using 'order' database and the API gateway is using the 'gateway' database, when making a request to order service, it uses the 'gateway' database to do database operations in the 'order' service and of course it throws an exception of table not found in 'gateway' database. So how can I solve this issue? Thanks.

0 likes
4 replies
mohafiz's avatar

I am using the Http client to make requests to the underlying services, if that would help in figuring out the issue.

topvillas's avatar
Level 46

Are you using Windows?

I had a similar issue a while ago and from what I could tell, it's a problem with Apache on Windows.

I solved it by putting the database configuration straight into the config file (not ideal by any stretch).

mohafiz's avatar

Thank, this was the issue, I moved to nginx and it worked.

Please or to participate in this conversation.