官网:http://www.wampserver.com/en/
下载地址:http://sourceforge.net/projects/wampserver/files/WampServer%202/WampServer%202.2/wampserver2.2d-x64.exe/download
各个版本:Apache 2.2.21 Php 5.3.10 Mysql 5.5.20 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0
然后安装php_memcache.dll 64位版本
提供者:http://www.anindya.com/php-5-3-3-x64-64-bit-for-windows/
下载地址:http://www.mediafire.com/file/u6y1f85gftrepwl/php_memcache-2.2.6-5.3-vc9-x64.zip (需要翻墙)
由于项目有用到redis,需要安装phpredis客户端,搜索了一圈,没有64位版本的,只能自己编译了。
phpredis项目地址:https://github.com/nicolasff/phpredis
下载:https://nodeload.github.com/nicolasff/phpredis/zipball/master
phpredis代码提示项目地址:https://github.com/ukko/phpredis-phpdoc
开始准备编译phpredis.dll 64位
1,获得php5.3.10版本的源码
下载地址:http://windows.php.net/downloads/releases/archives/php-5.3.10-src.zip
2,安装CygWin,安装到默认位置即可
(执行ext_skel_win32.php需要CygWin)
下载地址:http://cygwin.com/setup.exe
3,生成脚手架程序
cd php-5.3.10\ext
php ext_skel_win32.php --extname=redis
如果输出为:
Creating directory redis
Creating basic files: config.m4 config.w32 .svnignore redis.c php_redis.h CREDIT
S EXPERIMENTAL tests/001.phpt redis.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/redis/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-redis
5. $ make
6. $ ./php -f ext/redis/redis.php
7. $ vi ext/redis/redis.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/redis/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.
则生成成功,否则自己找原因吧
4,把redis的源码拷贝到ext/redis目录下面,覆盖
5,把wamp中的php5.3.10\dev\php5ts.lib拷贝到ext/redis目录下
6,由于我安装的是vs2005中文版,使用vs打开ext/redis/redis.dsp文件
7,添加目录中的.h文件到Header Files,.c文件到Source Files,注意不要漏了igbinary目录
8,vs 生成->配置管理器->活动解决方案平台->新建->x64->确定
9,项目属性,
常规:检测64位可移植性:是
预处理器:预处理器定义:删除LIBZEND_EXPORTS
启用浏览信息:无
高级:编译为:编译为c代码
10,尝试进行编译,报错 无法打开包括文件:“stdint.h”
这个是c99标准的头文件,vc不支持
去googlecode下载http://msinttypes.googlecode.com/files/msinttypes-r26.zip
解压后放到vc的include目录 D:\Program Files\Microsoft Visual Studio 8\VC\include
fatal error C1083: 无法打开包括文件:“../main/config.w32.h”: No such file or directory
需要把php源码目录configure下才有
11,主要过程参考Build your own PHP on Windows https://wiki.php.net/internals/windows/stepbystepbuild
cd php5.3.10
buildconf
main文件下有了config.w32.h文件就ok了
12,再尝试编译
错误:error C2275: “uint64_t”: 将此类型用作表达式非法
遇到类似的错误,修改代码,把变量定义提前
/* get position on ring */
uint64_t h64 = hash;
修改为:h64 = hash;把uint64_t h64放到函数最前面
错误:不允许 dllimport 函数 的定义
把所有的PHPAPI修改为ZEND_DLEXPORT
错误:无法打开包括文件:“stdbool.h”: No such file or directory
这个文件也是c99的,我从linux中拷贝了过来,放到vc的include目录下
stdbool.h
/*
* $Id: stdbool.h,v 1.1 2003/04/16 06:32:31 hpa Exp $
*
* stdbool.h
*/
#ifndef _STDBOOL_H
#define _STDBOOL_H
#ifndef __cplusplus
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
# if !defined(__GNUC__) ||(__GNUC__ < 3)
typedef char _Bool; /* For C compilers without _Bool */
# endif
#endif
#define bool _Bool
#define true 1
#define false 0
#else
/* C++ */
#define bool bool
#define true true
#define false false
#endif
#define __bool_true_false_are_defined 1
#endif /* _STDBOOL_H */
错误:无法解析的外部符号 __imp_setsockopt,该符号在函数 redis_sock_connect 中被引用
在项目属性->链接器->输入->附加依赖项 加入:ws2_32.lib
错误:library.obj : error LNK2019: 无法解析的外部符号 atoll,该符号在函数 redis_long_response 中被引用
把library.c中的atoll修改为atol
13,以上问题都解决了,再编译就好了
顺利生成php_redis.dll
下载地址:phpredis windows64位版本 phpredis 2.2.1版本
转载于:http://hi.baidu.com/rendong/item/c9cbacc289a4a4340831c60b