Chinaunix首页 | 论坛 | 博客
  • 博客访问: 45855
  • 博文数量: 7
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 110
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-22 09:29
文章分类
文章存档

2011年(1)

2009年(3)

2008年(3)

我的朋友

分类:

2009-09-01 09:17:37

当我安装好yii后,当我执行
[root@wolf yiiapp]# ../yii/framework/yiic shell
>> model User
出现一下错误:
Warning: YiiBase::include(PDO.php): failed to open stream: No such file or directory in /usr/local/Apache2/htdocs/yii/framework/YiiBase.php on line 324

Warning: YiiBase::include(): Failed opening 'PDO.php' for inclusion (include_path='.:/usr/local/Apache2/htdocs/yiiapp/protected/components:/usr/local/Apache2/htdocs/yiiapp/protected/models:/usr/share/pear:/usr/share/php') in /usr/local/Apache2/htdocs/yii/framework/YiiBase.php on line 324

Fatal error: Class 'PDO' not found in /usr/local/Apache2/htdocs/yii/framework/db/CDbConnection.php on line 282
解决方法:
执行yiic的时候要带上配置参数:
/usr/local/php5/bin/php -c /usr/local/php5/lib/php.ini ../yii/framework/yiic shell
Yii Interactive Tool v1.0 (based on Yii v1.0.8)
Please type 'help' for help. Type 'exit' to quit.
>> model User
   generate User.php

The following model classes are successfully generated:
    User

If you have a 'db' database connection, you can test these models now with:
    $model=User::model()->find();
    print_r($model);

>>
问题解决,进行下一步的工作。

阅读(2425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~