Openshift PHP PDO Mysql issue

I have uploaded and passed the install test for Concrete going on to the intallation where I put in the database name and login.

Here I am getting an error which has to do with environment variables and I have found the solution, but I do not know where to put this code at. Please help

below link has the solution, if someone with better insight help me connect to the database in openshift

View Replies:
mhawke replied on at Permalink Reply
IMHO, those hoops shouldn't be necessary. Are you committed to Openshift?
SignallHill replied on at Permalink Reply
Yes I would like to use open shift

There is a help section in open shift that talks about this. The link is

At the end it gives the code but is where does it go. Looking at other post in concrete forum I see the place below is the where it should go. But I don't have a clue on how to use it as I don't know php.


If its a simple fix then please help.
mhawke replied on at Permalink Reply
Well, you shouldn't make changes to the files inside the root/concrete folder because all your changes will be destroyed when you upgrade concrete5 to a new version. Other experts on Stack Overflow also suggest moving to a new host. PDO is a basic requirement of a secure server so I wouldn't mess around with trying to cobble something together.
SignallHill replied on at Permalink Reply
Thanks. ok I will look for other hosts.

Since I am abandoning this one what would the code look like if I were to change PDOconnections.php, just curious.

Here is the code thats need to be input

define('DB_HOST', getenv('OPENSHIFT_MYSQL_DB_HOST'));

$dsn = 'mysql:dbname='.DB_NAME.';host='.DB_HOST.';port='.DB_PORT;
$dbh = new PDO($dsn, DB_USER, DB_PASS);
mhawke replied on at Permalink Reply
Sorry, I have no clue. I've never played around with it. I have no time for curiosity unless it's leading me somewhere fruitful.
SignallHill replied on at Permalink Reply
The new update solved it. I should not have wasted my time here.
mhawke replied on at Permalink Reply
Sorry pshakya, I didn't mean to sound flippant or disrespectful of your curiosity. Sometimes pure text messages cannot express things properly. I should have been more careful. I'm glad the most recent version solved your issue.