CActiveRecord instantiating crashes Apache on xampp

Hey All,

I have searched around a bit, and I am sure I am being dense here, but I just cannot get this to work. Whenever I try to instantiate an AR model, Apache crashes with an error "Parent: child process exited with status 3221225477". After searching about for awhile, this seems to be a database problem, multiple errors across several layers of abstraction.

Cool, but what's wrong? Since I receive no worthwhile error messages, I can't figure it out.

Db Setup:

return array(


	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


	'name'=>'My Web Application',





	// autoloading model and component classes


	'import'=>array(


		'application.models.*',


		'application.components.*',


	),





	// application components


	'components'=>array(


		'user'=>array(


			// enable cookie-based authentication


			'allowAutoLogin'=>true,


		),


		// uncomment the following to set up database


		


		'db'=>array(


      'class'=>'CDbConnection',


			'connectionString'=>'mysql:host=localhost;dbname=gms',


      'username'=>'root', 


      'password'=>'', 


      'charset'=>'utf8'


		)


	)


);

And for good measure, here is the model:

class Game extends CActiveRecord {


  public static function model($classname = __CLASS__) {


    return parent::model($classname);


  }


  public function tableName() {


    return 'game';


  }


}

Now in the controller: GameController.php in the actionIndex() I call $game = new Game(); And it crashes…

I am sure I have done something retarded, or simply misconfed something, just don't know what…

/Jason

It seems what you did is pretty normal. This shouldn't be a PHP script error because theoretically a PHP error won't crash Apache. Maybe you should try a different version of PHP? What is your current version?

PHP 5.2.8 (cli) (built: Dec  8 2008 19:31:23)                                 


Copyright (c) 1997-2008 The PHP Group                                         


Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies                 


    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Techn


ogies                                                                         


    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies 

That is the output from php -v, which also crashes…

The php install comes with XAMPP…

A friend of mine, working with Yii as well is not having this problem, so it's pretty certain that there is a config issue with my system.

Hi!

Any movement on this thread?

I am experiencing the same problem… I am working on three different machines - two with Vista, one with Server 2003. The Server 2003 one goes and crash apache's proccess. I have reproduced the bug with PHP 5.2.8 and with PHP 5.2.9. On the Vista machines there were no problems with both versions of PHP. On all three machines the hole web stack is installed and configured manually by me…

I have trace the problem to line 275 of CDbCommand.php, that says:

Quote

$this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());

The _text is "SHOW COLUMNS FROM theRealTableName". The _statement is: "<Uninitialized>".

It executes all methods OK except the actual query of the PDO… The funny part is that it crashes in the try block. If I trace step by step, I can get to the query method of PDO class, but if I set a breackpoint there, it doesn't reach it.

Obviously it is some PHP/PDO related bug… So, please, help! :)

Edit: I had reproduce this error with simple PHP script. The PDO crashes Apache, when "show columns" statement is executed… I didn't found anything else for this bug. Any ideas?

ok, so I've done my homework - since this is a PDO bug, I've searched a while in the PDO related pages of php.net, where I found this:

Quote

practicegoodtheory at gmail dot com

19-Jun-2008 06:56

On Windows, with Apache, it would not load php_pdo_mysql.dll until I put libmysql.dll in Apache's dll path (e.g. apache/bin)

(http://bg2.php.net/manual/en/ref.pdo-mysql.php)

Well php loads PDO actually, but I've decided to give it a try and I copied the "libmysql.dll" to the Apache's bin directory, restarted the web server and it worked like a charm.

I hope this will help to someone in my situation… :)

Good job, and thank you for sharing your knowledge!