Yii Framework Forum: CActiveRecord instantiating crashes Apache on xampp - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CActiveRecord instantiating crashes Apache on xampp Rate Topic: -----

#1 User is offline   aimjiel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-December 08

Posted 23 December 2008 - 11:36 PM

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




0

#2 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 24 December 2008 - 07:40 AM

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?
0

#3 User is offline   aimjiel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-December 08

Posted 29 December 2008 - 09:49 AM

PHP 5.2.8 (cli) (built: Dec  8 2008 19:31:23)                                 
Copyright © 1997-2008 The PHP Group                                       
Zend Engine v2.2.0, Copyright © 1998-2008 Zend Technologies               
    with Zend Extension Manager v1.2.0, Copyright © 2003-2007, by Zend Techn
ogies                                                                       
    with Zend Optimizer v3.3.3, Copyright © 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.
0

#4 User is offline   Sentinel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 04-March 09
  • Location:Russe, Bulgaria

Posted 18 March 2009 - 11:23 AM

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?
0

#5 User is offline   Sentinel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 04-March 09
  • Location:Russe, Bulgaria

Posted 19 March 2009 - 12:03 PM

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/m...f.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... :)
0

#6 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 19 March 2009 - 03:14 PM

Good job, and thank you for sharing your knowledge!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users