IIS或Apache都没问题,MySQL都没问题,但觉得PHP的配置有点难
去下载 wamp安装 。一切搞定。
这样?我下载过XAMPP,添加APC时会出现Apache程序执行错误!
那我下载一个WAMP试试
我正在用XAMPP,不过没用过APC
晕!自己太笨了,原来APC扩展模块不是必需的
不知道你遇到过这种情况没有
当windows中运行crud的时候,总报错。
文件夹的权限已经设置可写,用户名也是同组了。就是不行
在linux下同样文件,就可用。
我才刚接触Yii,连基本的使用方法还没全部实验过。
这问题只能请大虾们回答啦
把具体错误信息说一下?
也没什么特殊要求把,随便从网上搜下搭建的教程,按照教程搭建就可以搞 yii 的吧。
Quote
1.当运行model user时候 一起良好,‘user’ class has been successfully created…
- crud user 报错
exception 'CDbException' with message 'Active Record requires a "db" CDbConnecti
on application component.' in E:\aaa\yii\framework\db\ar\CActiveRecord.php:723
这个如何调整?
1 你检查一下 生成的user里面是否有 table表?还有attributelabel里面是否有字段?
你配置'db'没有?
main.php中配置了db参数 比如用户名,密码,连接地址等
因为model 的时候系统创建文件良好,并且我拷入的库文件 就是blog那个范例文件。
你在创建model的时候,系统没有提示'db'不存在?
你退出yiic shell重新再来试试?
Quote
那我下载一个WAMP试试
我也是这个问题,不能启用APC,
查阅了大量资料,个人认为可能是因为APC需要一个临时缓存目录c:tmp,而XAMPP里的PHP.ini关于APC配置方面只很简单的列出了三条,三条我都试过了,不管怎么设置都不行
Quote
你退出yiic shell重新再来试试?
步骤如下:
C:\wamp\php>php e:\yii\framework\yiic webapp e:\yii\testcrud
Create a Web application under 'E:\yii\testcrud'? [Yes|No] yes
…
Your application has been created successfully under E:\yii\testcrud.
此时更改main.php文件里
'db'=>array(
//'connectionString'=>'sqlite:'.dirname(__FILE__).'/../data/blog.db',
// uncomment the following to use MySQL as database 'connectionString'=>'mysql:host=localhost;dbname=yiiblog',
'username'=>'root',
'password'=>'',
),
C:\wamp\php>php e:\yii\framework\yiic shell e:\yii\testcrud\index.php
Yii Interactive Tool v1.0 (based on Yii v1.0.5)
Please type 'help' for help. Type 'exit' to quit.
>> model Post
generate post.php
The 'post' class has been successfully created in the following file:
E:\yii\testcrud\protected\models\post.php
If you have a 'db' database connection, you can test it now with:
$model=post::model()->find();
print_r($model);
crud post
exception 'CDbException' with message 'Active Record requires a "db" CDbConnecti
on application component.' in E:\ethos\yii\framework\db\ar\CActiveRecord.php:852
这里开始就报错了
我应该如何调试一下?
你的'db'里没有connectionString啊。
Quote
有呀
'connectionString'=>'mysql:host=localhost;dbname=yiiblog',
'username'=>'root',
'password'=>'',
还需要设置什么吗? 提示一下
昨天刚刚操作了一下yiic shell,写了一篇博客,里面有需要注意到的事项,希望给初学者带来帮助,网址是:http://blog.csdn.net/zhoufoxcn/archive/2009/11/05/4769858.aspx