URL:http://blog.iyi.cn/start/2007/10/php_libmysqlmysqlnd.html
mysql 发不了一个MySQL native driver for PHP - mysqlnd来替代php5/php6中自带的mysqli模块,该模块可以在这里下载到:
- Download php_mysqli.dll for PHP 5.2.1 (Windows)
- Download source code (tar.gz)
- SVN repository: http://svn.mysql.com/svnpublic/php-mysqlnd/
- SVN Web Interface: http://svn.mysql.com/fisheye/browse/php-mysqlnd
安装方法是用该模块替换原来的mysqli模块,或者编译php之前,将ext/mysqli目录替换掉,然后在php源代码根目录执行:buildconf --force
编译的时候加上 --with-mysqli --enable-mysqlnd即可。
官方描述的这个模块的主要优点是:
On the C-level mysqlnd uses many of the proven and stable PHP internal functions. All the code of the new driver is contained in the ext/mysqli source directory. There is no need to link any external libraries. Thus you neither need to install the MySQL client library to compile PHP with ext/mysqli support nor do you need to take care of versions. Compiling has been made easier.
mysqlnd使用了很多底层的php函数,所有最新的驱动都包含在内,编译的时候不需要再额外关联其他的库。所以编译php的时候不需要先装mysql,也不需要关心mysql版本。编译极大的简化。
并且mysqlnd的性能有很好的改善,也修复了一些原有bug,比如
- improved persistent connections
- mysqli_fetch_all()
- performance statistics call: mysqli_get_cache_stats(), mysqli_get_client_stats(), mysqli_get_connection_stats()
Blitz (链接地址) 模板引擎是一个 PHP 扩展,号称是当前最快的模板引擎
下图是官方的一张表,比较了目前主流的PHP模板的速度,可以看出,它甚至比php includes 还要快.
你说牛不牛?
专为大型PHP 项目设计的模板引擎Blitz Templates
下载:sourceforge, 源码 homepage, win32 binaries
Blitz 项目正处在一个相当活跃的发展阶段,新的版本可能会每星期出现一次,但他很快,也很稳定.
Blitz 项目简介:
最可能的问题,当你第一次看到这篇文章时,你会问: "什么?又一模板引擎什么?"
这里有一个很简短的说明,Blitz 是一个有三个主要特点的PHP 模板引擎:
1.它是最快的模板引擎之一,它是由C编写的,并被编译为PHP 的扩展模块来使用;
2.它有简洁和清晰的语法;
3.以上二个特点让开发者得以编写紧凑和易读代码来实现非常复杂的逻辑应用。
大部分的模板策略并不能阻止开发者写出一塌糊涂的代码,这显然是令人相当不愉快。而Blitz 项目最主
要的目标是帮助开发者开发出简洁而轻快的PHP 项目,并且能迅速解决非常复杂和具有很多用户自定义
(比如web2.0)的应用难题。
上图是官方提供的测试数据,从途中测试数据可以看出来,Blitz 比php include还要快;同时还可以看出
php include其实也是很快的,至少比一般的模板引擎快很多,特别是ZPS(Zend Performance Suite)on
的情况下,虽然还是比Blits略慢,可见装一个PHP内存cache扩展加速是很有必要的,因此大家要使cache
此外Blitz 引擎的语法架构和phplib 那一类的模板引擎有点类似,是基于block的,模板用到的变量需要
注册,因此安全性会高一些,同时Blitz 的快速也是大家考虑使用它的因素之一。
(未完待续,上述均有usen翻译,如转载请注明来处,英文来处http://alexeyrybak.com/blitz/blitz_en.html )
如果你是一位 Linux 软件开发者,想要构建并打包自己的软件;又或者你就是普通的 Linux 使用者,看到中意的软件,而作者并没有提供二进制包;那么不妨来使用 openSUSE 所提供的自动构建和打包程序服务。
根据 openSUSE 方面的描述,该服务能够为下列流行的 Linux 发行版构建和打包软件:
- openSUSE
- SUSE Linux 和 Linux Enterprise
- Debian (Etch)
- Red Hat/Fedora/CentOS
- Mandriva
- Ubuntu
在构建和打包程序时,openSUSE Build Service 还可以根据程序的需要,针对不同的架构进行编译。
用于实现 openSUSE Build Service 的工具主机在 Novell 网站,有兴趣的同学可去瞧瞧。
来源
mysql 5.1支持触发器以及自定义函数接口(UDF)的特性,如果配合libmemcache以及Memcached Functions for MySQL,就能够实现memcache的自动更新。简单记录一下安装测试步骤。
安装步骤
- 安装memcached,这个步骤很简单,随处可见
- 安装mysql server 5.1RC,安装办法也很大众,不废话了
- 编译libmemcached,解压后安装即可./configure; make; make install
- 编译Memcached Functions for MySQL,在http://download.tangent.org/找一个最新的版本下载就是,./configure --with-mysql=/usr/local/mysql/bin/mysql_config --libdir=/usr/local/mysql/lib/mysql/
make
make install - 接下来有两个办法让Memcached Functions for MySQL在mysql中生效
- 在mysql的shell中执行memcached_functions_mysql源码目录下的sql/install_functions.sql,这会把memcache function作为UDF加入mysql
- 运行memcached_functions_mysql源码目录下的utils/install.pl,这是一个perl脚本,作用同上一条
测试memcache function
以下测试脚本摘自memcached_functions_mysql的源码目录,有兴趣可以试试
- drop table if exists urls;
- create table urls (
- id int(3) not null,
- url varchar(64) not null default '',
- primary key (id)
- );
- select memc_servers_set('localhost:11211');
- select memc_set('urls:sequence', 0);
- DELIMITER |
- DROP TRIGGER IF EXISTS url_mem_insert;
- CREATE TRIGGER url_mem_insert
- BEFORE INSERT ON urls
- FOR EACH ROW BEGIN
- SET NEW.id= memc_increment('urls:sequence');
- SET @mm= memc_set(concat('urls:',NEW.id), NEW.url);
- END |
- DELIMITER ;
- insert into urls (url) values ('http://google.com');
- insert into urls (url) values ('http://www.ooso.net/index.php');
- insert into urls (url) values ('http://www.ooso.net/');
- insert into urls (url) values ('http://slashdot.org');
- insert into urls (url) values ('http://mysql.com');
- select * from urls;
- select memc_get('urls:1');
- select memc_get('urls:2');
- select memc_get('urls:3');
- select memc_get('urls:4');
- select memc_get('urls:5');







