Category Archives: Php

PHP,是英文超文本预处理语言Hypertext Preprocessor的缩写。PHP 是一种 HTML 内嵌式的语言,是一种在服务器端执行的嵌入HTML文档的脚本语言,语言的风格有类似于C语言,被广泛地运用。

Linux下php安装Redis扩展

← Continue Reading
1、安装redis 下载:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz 上传phpredis-2.2.4.tar.gz到/usr/local/src目录 cd /usr/local/src #进入软件包存放目录 tar zxvf phpredis-2.2.4.tar.gz #解压 cd phpredis-2.2.4 #进入安装...

安卓端实现异步提交并下载注意事项

← Continue Reading
PC端异步提交后,可以执行window.open js方式直接从触发下载,而安卓浏览器异步请求后,屏蔽了非直接触发onclick事件执行open方法。所以可以使用折中的方式实现: 例: //提交数据,并返回下载地址 $.get("abcde.php", { a:a, b:b, c:c, d:d, e:e }, function(data){ if(data['status']=='1'){ ale...

Zend Framework MVC 核心之 Zend_Controller_Front

← Continue Reading
Zend/Controller包是Zend Framework MVC 的核心部分。也可以说是 Zend Framework 中最复杂的部分了。可以说搞清楚了Zend/Controller的复杂流程,就明白了半个Zend Framework。   Zend_Controller_Front Zend_Controller_Front类实现了单件模式。在应用的任何地方,通过:  ...

通过配置,使 nginx 支持thinkphp的 pathinfo访问格式

← Continue Reading
对于thinkphp框架项目的访问格式有多种,其中pathinfo是默认的基本访问格式,格式为:http://hostname:port/index.php/模块名/action名/参数1/参数1的值/ pathinfo其实就是一个参数,可以通过$_SERVER['PATH_INFO']获得,thinkphp框架通过解析它来找到对应的模块和方法。 apache服务器默认是支持pathinfo的...

Mac 下 Nginx、MySQL、PHP-FPM 的安装配置

← Continue Reading
Mac 下 Nginx、MySQL、PHP-FPM 的安装配置   用了3年多的本本罢工,最近新入手了一台 rmbp,一堆工作环境要配置,LNMP 里的 NMP 是常规要安装的,恰好也是第一次在 mac 上安装配置 nginx、mysql、php,所以顺便做个记录,免得以后忘了也好查看,不用到处翻。 PS:下面的安装都是基于 homebrew,如果不熟悉或者还没安装有 homebrew ...

mac or linux xamp and ssh2 install

← Continue Reading
#由于本机集成环境未安装ssh2扩展导致ssh2_connect函数无法使用,在官方找到了实现步骤。 #Linux or Mac 集成环境XAMPP扩展ssh2,其他扩展照此步骤应都可走通。 1.     2.  

制作接口时双方验证的token类

← Continue Reading
提供一个制作接口时双方验证的token类   <?php /** * Created by PhpStorm. * User: huwenfeng@xywy.com * * Date: 14-11-20 * Time: 下午3:27 */ class Api_Model_ToKenService { public function index(){ echo 'hello word...

清理smarty缓存

← Continue Reading
<?php /** * Created by PhpStorm. * User: Administrator * Date: 14-11-4 * Time: 下午1:41 * 清除smarty  生成的temp文件(可多次执行) */ date_default_timezone_set("Asia/Shanghai"); set_time_limit(0); ini_set('memory_...

php生成xml时添加CDATA标签

← Continue Reading
贴上代码留住伤疤,不要把<![CDATA[ $text]]>当成前后缀,其实它可以是标签。   <?php $dom = new DOMDocument("1.0"); // display document in browser as plain text // for readability purposes header("Content-Type: text/p...

通过PHP把PDF生成PNG图片

← Continue Reading
需求:通过PHP把PDF生成PNG图片,一般用在在线阅读浏览用的。 Windows下实现: 1.PHP的DLL扩展下载地址:http://valokuva.org/outside-blog-content/imagick-windows-builds/ 2.里面有用于PHP不同的版本DLL,要注意和你的版本相同 3.把下载好的DLL改名成 php_imagick.dll(我是下载的php_...

yii widget的简单使用

← Continue Reading
WIDGET定义很简单,如果你在/protected/widget/test/下建立了一个名为“testWidget.php”的widget。   在视图中调用需要这样写:   $this->beginWidget('application.widget.test.testWidget');   $this->endWidget(); testWidget...