Hush Framework的配置与常见问题

来源:互联网 发布:全国火灾数据统计 编辑:程序博客网 时间:2024/05/20 07:51

 最近在看php服务器搭建的知识,在买的书《Android和PHP开发最佳实践》中,作者推荐了php服务器框架hush framework。这个框架是基于Zender和Smarty之上的。既然是框架,第一步首先是配置框架,这里有他官网的配置流程

http://blog.csdn.net/binyao02123202/article/details/11761931

       基本按照官网流程配置能配个八九不离十,但是在细节上还是遇到了问题,这里记录如下

1.按照配置流程,直接下载hush framework的源代码并用“hush sys init”编译失败,提示MySQL导入文件找不到。

这个问题应该是下载的sql文件文件编码格式和mysql服务器不匹配缘故,这里直接下载官网中提供的微博实例完整源码包(其中附带了hush framework)运行配置就会成功。


2.在运行“hush sys init”的时候,提示mysql access deny。

这是因为 hush framework默认mysql数据用户名root ,密码是passwd,而xampp中mysql的root用户是没有密码的。解决方法是启动Xammp控制台的phpMyAdmin,为root用户设置密码passwd。

当然 你这里修改了mysql的密码,还需要同时修改phpMyAdmin的默认登陆mysql密码才能正常使用phpMyAdmin管理mysql。

在phpMyAdmin中修改默认密码如下

找到配置目录,

D:\xampp\phpMyAdmin\config.inc.php

/* Authentication type and info */$cfg['Servers'][$i]['auth_type'] = 'config';$cfg['Servers'][$i]['user'] = 'root';$cfg['Servers'][$i]['password'] = '';$cfg['Servers'][$i]['extension'] = 'mysql';$cfg['Servers'][$i]['AllowNoPassword'] = true;

修改为

/* Authentication type and info */$cfg['Servers'][$i]['auth_type'] = 'config';$cfg['Servers'][$i]['user'] = 'root';$cfg['Servers'][$i]['password'] = 'passwd';$cfg['Servers'][$i]['extension'] = 'mysql';$cfg['Servers'][$i]['AllowNoPassword'] = true;



3.在“hush sys init”时,会运行mysql -h127.0.0.1 -P3306 -uroot -ppasswd 提示无法连接数据库之类的

这可能是因为 主机地址 127.0.0.1 没有被mysql自动转换为localhost的缘故。在mysql中添加用户,并手写指定用户服务器地址(主机)为127.0.0.1。


4. 在登录其框架网站如hush-app-frontend,网页提示没有权限。

这是因为Apache服务器默认的请求响应全部是deny的原因,需要配置Apache服务器。

找到服务器配置文件

httpd.conf,修改节点 为下面内容即可

<Directory />     AllowOverride All     Order deny,allow     Allow from all</Directory>

5.在Android客户端登录时,提示Json格式错误。

找到android-php demo的server目录下的

etc/global.defines.php的error_reporting设置,修改为:error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));


好了,目前就碰到这些问题。 下面是我百度云盘里面的项目源码

http://pan.baidu.com/s/1kTFqUmb


0 0
原创粉丝点击