在按照Yii文档做自己的第一个例子的时候,在创建Model的页面出现“CDbConnection failed to open the DB connection: could not find driver"错误,其中数据库自己使用的sqlite数据库。
出现这个问题后突然想起在安装完Yii时,文档里给了一个测试页面(http://localhost/yii/requirements/index.php),可以查看Yii的依赖检查,再次查看这个页面发现“PDO SQLite extension”的检查结果是Warning,于是想是不是自己没有按照php的sqlite pdo包,于是使用以下命令安装了sqlite包并重启了apache服务
sudo apt-get install php5-sqlite php-pear php-db sudo /etc/init.d/apache2 restart再次访问http://localhost/yii/requirements/index.php页面,发现其中的Waring已经Passed状态了。再次访问创建Model页面,也可以创建Model了。
政府网站建设考核细则工作手机
转载于:https://www.cnblogs.com/wdpp/archive/2011/09/11/2386240.html