This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » Symfony 1.4 Propel connection problem
Symfony 1.4 Propel connection problem [message #103212] Wed, 28 July 2010 21:38 Go to next message
tayhimself  is currently offline tayhimself
Messages: 65
Registered: April 2007
Member

My setup is as follows. RHEL with Apache & php 5.3 (remi repository). I have php-pdo installed. Symfony 1.4.5. Connecting to a MySQL database.

1. I can connect to the database using plain old PDO from my web server VM.
2. I can connect to the database when using PDO / Propel and the command line in symfony this way. The code below is taken from a file in the <project>/lib/myCommandLineProgram.php that i invoke from the command line.
require_once(dirname(__FILE__).'/../../config/
ProjectConfiguration.class.php');
$configuration =
ProjectConfiguration::getApplicationConfiguration('survey', 'dev',
true);
sfContext::createInstance($configuration);
$databaseManager = new sfDatabaseManager($configuration);
$databaseManager->loadConfiguration();
$c = new Criteria();
......

3. It works on the test server with the mysql server on the same host with the same username and database name.

But every time I try connecting in my symfony application it dies when trying to access the database with the error (in the symfony log file)
symfony [err] {PropelException} Unable to open PDO connection
[wrapped: SQLSTATE[HY000] [2003] Can't connect to MySQL server on
'x.x.x.x' (13)]


I have no idea what the error could be or why it is happening.
Thanks for your time.
index.php/fa/1619/0/

[Updated on: Thu, 29 July 2010 00:03]

Re: Symfony 1.4 Propel connection problem [message #103215 is a reply to message #103212 ] Wed, 28 July 2010 23:35 Go to previous messageGo to next message
xplo  is currently offline xplo
Messages: 428
Registered: September 2008
Faithful Member
You server cannot connect to the mysql server.

Can you connect to mysql from mysql linux command from your server ?
are you sure your mysql server listen something else than localhost ? (default config is localhost only)
did you try symfony cc ?
Re: Symfony 1.4 Propel connection problem [message #103216 is a reply to message #103215 ] Wed, 28 July 2010 23:49 Go to previous message
tayhimself  is currently offline tayhimself
Messages: 65
Registered: April 2007
Member

Thanks for the reply but I can connect from the command line using symfony that is using the symfony configuration. I wasn't clear in my post and have edited it for clarity. I did cc and even re-deployed the project to no avail.
Previous Topic:Possible colision between inheritance and sluggable behaviour when creating tables
Next Topic:How to prevent blank embed form objects being saved?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software