大海
wytoy · 共 24 篇文章
nginx已经启动 无法访问页面
nginx+php+mysql 都安装好了 通过IP访问,可以看到 welcome nginx 的提示 下面我重启linux服务器,重启后通过ip访问,死活连接不上了?没办法了,只有在百度和google 最后发现问题不是出在nginx上,而是出在iptable上,在iptable上添加80端口 #vi /etc/sysconfig/iptables //在倒数第二行加入80端口 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT //重启iptables #/etc/init.d/ipt…
2013-03-12 21:56 · 评论(1)
只有360浏览器报错
今天完成了一个功能,上线后只有360浏览器报错,ie,ff,google都是正常的,最后找到原因了 原来360浏览器不支持json这样写 把后面的 逗号去掉 就没问题了~
2013-03-12 21:48 · 评论(1)
linux 下下载百度网盘
今天需要传1G的东西到服务器下,用拖的要很久,没办法了 就用wget下载 一、需要共享百度网盘里面的文件 二、进入下载网盘下载页面后,复制连接 三、wget -c -O test.zip "url" (url=刚复制的连接) 这个 test.zip就是下载后的重命名
2013-03-12 21:47 · linux · 评论(0)
yii 模块的使用
yii模块的创建 用gii就可以了 创建好后,发现layout调用的还是外部main.php,但是既然为模块,所以肯定不能用外面的嘛 怎么修改,好使用自己本身的main.php呢? 以我本身为例子,我创建了一个 admin模块,添加以下代码 class DefaultController extends Controller { public $layout = 'main'; public function actionIndex() 没错,就是在controller中添加一个layout的属性,就可以了~ 别忘记修改配置 'modules'=>array( 'admin'=>array(…
php 一些特殊用法
今天发现了 php的一些特殊用法 if (): //这里是冒号 else: //这里是冒号 endif; //这里是分号
2012-08-24 14:10 · php · 评论(0)
yii checkbox 去掉换行和默认选项
先说换行吧,这个和radio一样的 $form->checkBoxList($model,'like',array(1=>'篮球',2=>'羽毛球',3=>'音乐'),array('template'=>'<span class="check">{input}{label}</span>','separator'=>' ') 再说默认: 如果是添加 那么它会默认数据库中的默认值 如果是修改 在controller中设置,就会默认了 $model->like = array(1,2);
2012-08-23 18:04 · yii · 评论(0)
yii chtml radio创建和横排
view中: <?php echo $form->labelEx($model,'性別'); ?> <?php echo $form->radioButtonList( $model, 'sex', array(1=>'男',2=>'女'), //给出radio模板 array('template'=>'<span class="radio">{input}{label}</span>', //不要换行 'separator'=>'') ); ?> <?php echo $form->error($model,'sex'); ?> 添加CSS .form .radio{ width:30px…
2012-08-23 16:22 · yii · 评论(0)
yii 如何在底部加载js
<?php //在开始加载 Yii::app()->clientScript->coreScriptPosition = CClientScript::POS_BEGIN; //这些不加载 Yii::app()->clientScript->scriptMap=array('jquery.js'=>false,'jquery.min.js'=>false); //在底部加载自定义JS Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/js/test.js",CClientScript::POS_END);…
2012-08-22 17:27 · 评论(0)
yii 获取当前 controller
如何获取当前 Controller 呢? 比如要在文件siteController.php文件中获取 当然是 $this 咯~ (呵呵,之前可以当废话) 但是可能在 Controller 中用到别的文件,此时我们就不能用 $this 了 Yii::app()->getController() 来代替$this吧 ~
2012-08-16 16:10 · yii · 评论(0)
yii 缓存页面,更新部分 renderDynamic
view 中添加 actionEchoName 为 当前controller中的方法名 <?php $this->renderDynamic('actionEchoName'); ?> 当前 controller 中添加 //過濾器 public function filters() { return array( //缓存整个页面 array( 'COutputCache', 'duration'=>100, 'varyByParam'=>array('ddd'), ), ); } //view 中 renderDynamic 的回调方法 public function actionEch…
2012-08-16 16:10 · 评论(0)
yii 获取当前 controller
如何获取当前 Controller 呢? 比如要在文件siteController.php文件中获取 当然是 $this 咯~ (呵呵,之前可以当废话) 但是可能在 Controller 中用到别的文件,此时我们就不能用 $this 了 Yii::app()->getController() 来代替$this吧 ~
2012-08-16 15:48 · yii · 评论(0)
yii filter 过滤使用
废话少说,上代码 public function filters() { //过滤只用于actionEdit和actionCreate方法 return array( 'test + edit, create', ); } //定义的过滤方法 public function FilterTest($filterChain) { //判断什么的 //过滤完后继续执行代码 $filterChain->run(); }
2012-08-16 15:13 · yii · 评论(0)
安装nginx-http-concat和nginx平滑升級
Nginx_concat_module 是淘宝开发的基于Nginx减少HTTP请求数量的扩展模块,主要是用于合并减少前端用户Request的HTTP请求的数量 下载后把它放在/usr/local/src/文件夹中,到时候nginx需要指定该目录 这个需要重新编译nginx,所以顺便把nginx升级了下。 下载最新版本 wget http://nginx.org/download/nginx-1.0.15.tar.gz 查看之前安装时怎么配置的,copy下红色代码,这里是下面要用到的 /usr/local/nginx/sbin/nginx -V TLS SNI support disabled…
2012-05-02 10:16 · other · nginx nginx-http-concat · 评论(0)
Linux下安装mysql-5.5
mysql 升级后需要cmake才能安装 # wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz/from/http://mysql.cs.pu.edu.tw/ # wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz # tar zxvf cmake-2.8.5.tar.gz # cd cmake-2.8.5 # ./bootstrap # make # make install //这次没有报错 记得在另外一台机器上安装的时候报错 CMake …
2011-08-30 22:55 · linux · 评论(0)
云在线编辑器
给大家介绍一个云编辑器 http://kodingen.com/ 开发者可以越过传统的服务器设置、配置、或其他开发环境相关的头疼的事儿,轻松、快捷的运转项目。 会分配给你二级域名和多个三级域名 如果你想创建自己的blog,又苦于找不到好的空间,那么它是一个好的选择(免费、高效) httpdocs就是http目录。当访问wangyangtoy.kodingen.com时,就会访问index.html,test中有一些例子,都是可以访问的。php、python 都是可以的。 在我的账户中,可以创建域名,FTP,SVN 应该够你用了吧。 在这里大家可以安装app,呵呵 看到wordpress相信大…
2011-08-08 21:59 · other · 评论(0)