Connecting two laravel application to one database Openshift

136 views Asked by At

I am using openshift I have tried to connect both my application to the same database okay. So far I have tried this

rhc env-set OPENSHIFT_EXTMYSQL_DB_HOST=someIpAdress OPENSHIFT_EXTMYSQL_DB_PORT=somenumber OPENSHIFT_EXTMYSQL_DB_PASSWORD=dummyvalue OPENSHIFT_EXTMYSQL_DB_USERNAME=adminT2khp1e OPENSHIFT_EXTMYSQL_DB_NAME=appwithdb

To set the environment

but when i push my code i get no routing to host also if I restart an try to connect to database i get the whoops message.

Can any one explain or direct me to a way to guide me in setting this up

I also added OPENSHIFT_EXTMYSQL_DB_USERNAME or DB_etc to my database file in the config folder

No matter how I try it doesn't work was following this blog for php thought it would work for Laravel 5 https://blog.openshift.com/sharing-database-across-applications/

1

There are 1 answers

0
AudioBubble On

You need to run one of the laravel applications as a scaled application (the one with the database). That way the database will be created on it's own gear and will be accessible to any of your other applications that you create.