zoukankan      html  css  js  c++  java
  • 在Windows环境下编译、配置eAccelerator加速PHP

    转载http://blog.zzjt.net/in-the-windows-environment-compile-configure-speed-up-php-eaccelerator.html

    本文使用到的程序以及版本下载地址如下:

    (笔者使用fast-cgi模式运行php,请根据自己的实际情况进行相关的改动和配置,本文附件提供php5.3.6VC9nts以及php5.2.17vc6nts(使用VC6.0编译)编译后的 eAccelerator v0.9.6.1下载 。)

    Php5.3.6(VC9 x86 Non Thread Safe)下载地址:http://windows.php.net/download/

    Php5.3.6源文件(PHP 5.3.6 (tar.bz2) 下载地址:http://www.php.net/downloads.php

    eAccelerator v0.9.6.1(源文件)下载地址:http://eaccelerator.net/

    Visual Studio 2008 express下载地址:http://msdn.microsoft.com/zh-cn/express/

    Nginx1.0.0 下载地址:http://nginx.org/en/download.html

    bison.exe 下载地址:http://gnuwin32.sourceforge.net/packages/bison.htm(此文附件也提供下载)

    --------------------------------------------------------------------------------------------------------------------

    好了,我们现在开始:

    第一步、解压下载到得php5.3.6源文件包tar.bz2包到C盘c:\phpy,并且解压php5.3.6(VC9 x86 Non Thread Safe,也就是能够正常使用的php压缩包文件)到C:\php,我们只需要里面的一个文件C:\php\dev\ php5.lib,复制php5.lib到c:\phpy。

    第二部、复制bison.exe到C:\Program Files\Microsoft Visual Studio 9.0\VC\bin(也就是Visual Studio 2008 express安装后的路径)

    第三部、在这里我们开始生成生成config.w32.h。打开开始菜单找到Visual Studio 2008里面的命令提示,在里面操作:

    点击查看原图

    进入:c:\phpy执行buildconf.bat,

    建立一个临时环境变量

    执行set path=%path%;C:\phpy\bin

    执行 cscript /nologo configure.js --with-php-build="../phpy" --without-libxml --disable-odbc --disable-zts

    如果想要Thread Safe 模式就去掉上面的命令最后的参数 --disable-zts

    然后看看是不是main下面多了一个 config.w32.h

    第四步、在C:\phpy\ext下建立文件夹eaccelerator将eAccelerator v0.9.6.1(源文件)解压后里面的全部文件复制到C:\phpy\ext\eaccelerator文件夹内,启动Visual Studio 2008打开C:\phpy\ext\eaccelerator\win32\eAccelerator.dsw文件,点击Visual Studio 2008菜单“生成->配配置管理器-活动解决方案配置-Release-NTS-关闭”-->“生成->生成eAccelerator”

    点击查看原图

    OK,这时候你会发现C:\phpy\ext\eaccelerator\win32\Release里面已经生成了一个eAccelerator.dll文件,将此文件复制到c:\php\ext里面即可现在这个文件已经能够使用了,并且是根据你现在正在使用的php版本生成的eAccelerator。

    ------------------------------------------------------------------------------------------------------------------------------------

    下面是配置eAccelerator,在C盘建立目录eAccelerator

    打开PHP.INI

    在其中增加以下代码:

    [eAccelerator.dll]

    zend_extension="C:/PHP/ ext/eAccelerator.dll"

    eaccelerator.shm_size="16"

    eaccelerator.cache_dir="C:/ eAcceleratorCache"

    eaccelerator.enable="1"

    eaccelerator.optimizer="1"

    eaccelerator.check_mtime="1"

    eaccelerator.debug="0"

    eaccelerator.log_file = "C: /eAcceleratorCache/log/eaccelerator_log"

    eaccelerator.filter=""

    eaccelerator.shm_max="0"

    eaccelerator.shm_ttl="0"

    eaccelerator.shm_prune_period="0"

    eaccelerator.shm_only="0"

    eaccelerator.compress="1"

    eaccelerator.compress_level="9"

    重新启动php-cgi.exe,OK,配置完成!

    点击查看原图

    点击查看原图

    转自http://blog.zzjt.net/

  • 相关阅读:
    c# 生成、读取xml
    http长连接与短连接
    p.net 子页面刷新父页面,页面自动刷新方法汇总
    遍历页面上所有控件
    从数据库导入到Excel表格(同时传四个表的数据到一个Excel中)
    .net海量数据分页通用存储过程
    SQL大数据量分页存储过程效率测试
    给一个接口传递参数,并接收返回的参数
    在asp.net中长内容自动分页的实现.NET教程
    GridView72般技巧
  • 原文地址:https://www.cnblogs.com/bullz/p/2249776.html
Copyright © 2011-2022 走看看