当我安装好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) |