Can't Get Script Using Yii Framework To Connect To Databases Which Wordpress Can.

Hi,

I’m using a script which uses v1.1.7 of the framework to connect to a Mysql database to install. However i’m having major problems getting the script to connect to multiple database installs which Wordpress can access and install to just fine. The developer of the script pointed me here to see if anyone had any input.

I’m using Amazon’s EC2 for our VPS instances. Ive tried on the nginx install that our website was running and with no luck couldn’t connect to the localhost SQL. I’m also running an RDS database on AWS which is for our Wordpress site - Ideally id like the script to use that database so all the data is in one place when scaling up, however it won’t connect to an RDS database which Wordpress speaks to just fine. Since then I’ve tried another simple LAMP installation on Ubuntu and once again Wordpress will connect and install to the localhost SQL but the script wont. In all circumstances it throws up the error message…

Database error0CDbConnection failed to open the DB connection.

What is strange is that on a bitnami LAMP install I got it to connect to the database just fine (and then ran into other problems with the script) so I don’t know what is different between the mysql access on either site where Wordpress can access both just fine but the script using this framework throws up the above error message.

For RDS the details are similar to this…

hostname: database-name.czsy4cv8uhnr.us-east-1.rds.amazonaws.com

user: username

pass: password

dbname: dbname

For some reason the script just won’t connect to these details - has anyone else managed to use Yii framework to speak to an RDS database? Is there any tricks to this, perhaps an updated version of Yii framework as this is obviously a bug somewhere.

Failing working with RDS at all, what could be different between the LAMP and linux installs so that one install speaks to the database settings fine and the other won’t - despite Wordpress being able to access either and all settings being correct? Is there an apache2 or php5 setting I need to change? Are there extra dependencies I should try? Any suggestions would greatly help as I’ve totally hit a brick wall with this and am one step away from returning the script, but we could really do with getting it to work for our site.

Hi,

Could you post the snippet you use to connect to the database?

I’ve never used it to connect to an RDS database, nor have I got a lot of experience. But without any kind of script, all we can do is guess.

P

Aha, after 5 days of trying, I accidentally stumbled upon the answer myself.

I installed all the extensions for php 5.3 I could find, and finally it worked! It even installs to RDS ok now. So it needed something to make the connection ok. I’m not sure exactly which extension it wanted and I dare not try it with php fpm 5.4 on Nginx!