最新 分享

Publish our news and thoughts with all.

Popular Articles

Recent Stories

解决Ubuntu系统中phpmyadmin上传上限2M的限制

There is no translation available.

ubuntu中php.ini的路径和其他linux不一样,ubuntu的路径为:/etc/php5/apache2/php.ini,sudo vi /etc/php5/apache2/php.ini
1、查找 post_max_size,指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值,默认为8M,看你自 己需要进行改变。

在ubuntu12.04上架设LAMP(Linode完整教程)

There is no translation available.

This guide provides step by step instructions for installing a full featured LAMP stack on an Ubuntu 12.04 (Oneiric) system.

In this guide, you will be instructed on setting up Apache, MySQL, and PHP. If you don't feel that you will need MySQL or PHP, please don't feel obligated to install them. Make sure you're logged into your Linode as the "root" user via SSH before proceeding with these instructions.

14个实用的脚本下载网站

There is no translation available.

本文收集了14个实用的脚本下载网站,如果你也有好的资源推荐请在评论中给予补充。

1.ScriptCopy

ScriptCopy.com是个PHP脚本的资源站,这里有很多流行的网站脚本。比如:Youtube、Craigslist。

PHP实现301页面永久性跳转

There is no translation available.

比如要从根目录跳转到X目录,语法如下:

SciTE如何与PHP配合?

There is no translation available.

请假设已构建这样一个环境(也就是我自己的环境),所有与研发相关的内容都放置在E:\Develop目录中。这些内容包括:SciTE、PHP、PHP Manual(那份标记为ex的官方手册)、PHP Code Beautifier(http://www.waterproof.fr/products/phpCodeBeautifier/)。

一个判断字符串是UTF边还还是GBK编码的PHP函数

There is no translation available.

function is_utf8($string) { return preg_match('%^(?:[\x09\x0A\x0D\x20-\x7E]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$%xs', $string);

}

Xdebug、Zend bugger与Zend Optmizer不兼容问题

There is no translation available.

PHP.ini的配置文件: [Xdebug] zend_extension_ts="d:/wamp/php/ext/php_xdebug-2.0.4-5.2.8.dll" xdebug.default_enable = On xdebug.profiler_enable=on xdebug.auto_trace=on xdebug.collect_params=on xdebug.collect_return=on xdebug.trace_output_dir="D:\wamp\debugcache" xdebug.profiler_output_dir="D:\wamp\debugcache" xdebug.remote_enable=on xdebug.remote_handler=dbgp debug.remote_mode=req xdebug.remote_host= localhost xdebug.remote_port=9000 xdebug.idekey=ECLIPSE_DBGP xdebug.show_exception_trace=on xdebug.show_local_vars=on xdebug.show_mem_delta=on

前面找了一篇Xdebug的使用方法,但是没成功,尝试新的配置

There is no translation available.

在网上看到一篇文章说xdebug+wincachegrind是php性能调优好工具。于是去下载了这个,安装使用一下看看。:)

下面是我的安装配置

1 下载xdebug http://www.xdebug.org

下载wincachegrind:http://sourceforge.net/projects/wincachegrind/

2 把xdebug copy到php扩展文件目录:d:/wamp/bin/php/php5.2.5/ext/

编辑php.ini ,在其中添加如下配置行:

zend_extension_ts="d:/wamp/bin/php/php5.2.5/ext/xdebug.dll"

;;;;;;;;;;;;;;;;;;;

; Xdebug Settings ;

;;;;;;;;;;;;;;;;;;;

xdebug.auto_trace=On

xdebug.collect_params=On

xdebug.collect_return=On

xdebug.trace_output_dir="d:/wamp/bin/php/debuginfo"

xdebug.profiler_enable=On

xdebug.profiler_output_dir="d:/wamp/bin/php/debuginfo"

然后重新启动apache.

配置说明

zend_extension_ts="d:/wamp/bin/php/php5.2.5/ext/xdebug.dll"

加载xdebug模块。这里不能用extension=php_xdebug.dll的方式加载,必须要以zend的方式加载。安装文档上说的。

xdebug.auto_trace=on;

自动打开“监测函数调用过程”的功能模块。该功能可以在你指定的目录中将函数调用的监测信息以文件的形式输出。此配置项的默认值为off。

xdebug.collect_params=on;

打开收集“函数参数”的功能。将函数调用的参数值列入函数过程调用的监测信息中。此配置项的默认值为off。

xdebug.collect_return=on

打开收集“函数返回值”的功能。将函数的返回值列入函数过程调用的监测信息中。此配置项的默认值为off。

xdebug.trace_output_dir="d:/wamp/bin/php/debuginfo"

设定函数调用监测信息的输出文件的路径。

xdebug.profiler_enable=on

打开效能监测器。

xdebug.profiler_output_dir="d:/wamp/bin/php/debuginfo"

设定效能监测信息输出文件的路径。

3 安装WinCacheGrind,这个就不用说了:)。

4 打开IE访问http://localhost:8080/demo/index.php

然后打开目录:d:/wamp/bin/php/debuginfo/ 可以看到自动生成的文件cachegrind.out.xxxx 和 trace.2732500414.xt

用WinCacheGrind就可以看到index.php执行过程中调用了那些function,mothed,定义了那些变量,载入了那些文件和执行这些操作花费的时间。

呵呵,这样就可以开始寻找那些花费时间最都的操作了!

下面贴个图: