PHP开发常见问题解决列表
2013-12-06 13:37
330 查看
1. 学习Zend Framework tutorial过程中的问题
(1)执行"zf create project zf-tutorial"出现如下错误:'"php.exe"' is not recognized as an internal or external command, operable program or batch file.
解决办法:原因是因为php.exe所在的路径没有加到系统环境变量Path中。加入后即可解决。
(2)访问http://localhost/zf-tutorial/public时出现403Forbidden错误。这个问题搞了我很久,最后发现是public下的.htaccess配置不当造成的,将文件内容替换为如下就可以解决了。目前源文件配置较为复杂,没看懂,先解决问题再继续研究。
RewriteEngine on
RewriteRule !/.(js|ico|gif|jpg|png|css)$ index.php
2. 安装phpMyAdmin3.0过程中的问题
(1)The configuration file now needs a secret passphrase (blowfish_secret);解决办法:在phpmyadmin目录下的config.inc.php文件中,修改
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
为:
$cfg['blowfish_secret'] = 'holla'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! *
3、It is not safe to rely on the system's timezone settings
在写php程序中有时会出现这样的警告:PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:\PHPWEB\news\file.php on line 17 。这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即<?phpdate_default_timezone_set("PRC");?>就可以了。
2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。
4、Property "CWebApplication.errorHandler" is read only.
Quote CException Property "CWebApplication.errorHandler" is read only. D:\WAMPx64\www\yii\framework\base\CModule.php(467) 467 $this->$key=$value;
Check in your config file (protected/config/main.php) that the "errorHandler" configuration is inside the components section... seems it's outside... and that's why you are getting this error...
5、Yii框架下的空白页问题,IE访问testdrive/index.php?r=post/query时,是一个空白页问题
错误原因是:在PostController中,重叠定义了ActionID,导致了PostController中所有的ActionID都无效了。如下面我的代码中两个重叠的edit方法
public function actionEdit() { echo 'edit'; } public function actions() { return array( 'edit'=>'application.controller.post.UpdateAction' ); } public function actionEdit() { $post = Post::model()->findByPk(10); $post->title='test'; $post->save(); } public function actionQuery() { ... } //其他方法
相关文章推荐
- PHP开发常见问题解决列表
- PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
- PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
- PHP开发中常见的安全问题详解和解决方法
- Windows下的PHP开发环境配置及常见问题解决
- PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
- PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
- 在vs2008开发PHP扩展之三--环境搭建常见问题列表。
- PHP开发中常见的安全问题详解和解决方法
- WEB前端开发人员须知的常见浏览器兼容问题及解决技巧
- WEB前端开发人员须知的常见浏览器兼容问题及解决技巧
- ios开发中的常见问题和解决以及总结
- Atitit.angular.js 使用最佳实践 原理与常见问题解决与列表显示案例 attilax总结
- iOS开发之Xcode的静态分析(Static Code Analysis)与常见问题解决
- 编译安装apache+php(加常见问题解决)
- android+PHP+mysql开发编码问题解决方案
- WEB前端开发人员须知的常见浏览器兼容问题及解决技巧
- 微信开发之php表单微信中自动提交两次问题解决办法
- 常见PHP页面漏洞分析及相关问题解决
- 5个Android开发中比较常见的内存泄漏问题及解决办法