广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > 在win2003上配置IIS6运行php5和IIS上配置ECshop伪静态

二次开发Ecshop二次开发

二次开发Ecshop二次开发

在win2003上配置IIS6运行php5和IIS上配置ECshop伪静态

第一步:在win2003上安装php5和mysql

下载php5版本和mysql(mysql-5.5.16-win32版本)并安装。安装步骤略!~~
注:php安装在C:\PHP5上。后面配置的时候要用到。

第二步:在IIS上配置运行PHP

1、首先在php的安装文件夹里复制php5ts.dll(C:\php5\php5ts.dll)到C:\Windows\system32文件夹下
2、在php的安装文件夹根目录下找到php.ini-recommended,改成php.ini。复制到C:\Windows\文件夹下
3、在C:\Windows\php.ini找到extension_dir ="./"改成extension_dir ="C:/php5",要支持扩展的话也可以改成extension_dir ="C:/php5/ext"
4、在IIS上配置php:
      4.1、打开IIS,在web服务扩展中点击“添加一个新的web服务扩展”。在新建Web服务扩展窗口,在扩展名处填php,把C:\php5\php5isapi.dll添加上去,点击设置扩展状态为允许。点确定。
      4.2、在你的站点选属性 --> 主目录 --> 配置。在应用程序配置窗口中的映射里添加应用程序扩展。将C:\php5\php5isapi.dll 添加上去,扩展名设为php。
     4.3、用phpinfo()文件测试是否能允许php。

第三步:安装ecshop程序。略:

安装的过程中你必须把data文件夹权限设为可写入,安装过程中需要php支持mysql。具体步骤是将C:\php5\libmysql拷贝到C:\Windows\system32文件夹下。然后打开php.ini找到extension=php_mysql.dll把前面的;去掉。重启IIS。

第四步:配置伪静态

1、首先请进入以下网址 http://www.helicontech.com/download/,下载免费版的ISAPI_Rewrite组件:ISAPI_Rewrite Lite ( freeware )。如果您仅仅是测试用途使用这个就足够了,如果您是商业应用建议您购买完整版的 ISAPI_Rewrite Full。
2、点击下载到本地的文件 isapi_rwl_x86_0064.msi (该文件名和您下载的版本有关)进行安装,安装成功之后进入安装目录(默认在C:/Program Files/Helicon/ISAPI_Rewrite)找到httpd.ini文件,点击右键将文件只读属性去掉。然后进入: 开始菜单->程序->Helicon->ISAPI_Rewrite->httpd.ini,点击打开 httpd.ini 文件。
3、复制下面的内容到httpd.ini文件并保存。
 

# 为了确保重写规则不影响服务器上的其他站点
# 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改为商店所在域名

#RewriteCond %{HTTP:Host} (?:www\.)?site1\.com

RewriteRule ^(.*)/index.html$                $1/index\.php           [I]
RewriteRule ^(.*)/category$                  $1/index\.php           [I]
RewriteRule ^(.*)/feed-c([0-9]+).xml$        $1/feed\.php\?cat=$2    [I]
RewriteRule ^(.*)/feed-b([0-9]+).xml$        $1/feed\.php\?brand=$2  [I]
RewriteRule ^(.*)/feed-type([^-]+)\.xml$     $1/feed\.php\?type=$2   [I]
RewriteRule ^(.*)/feed.xml$                  $1/feed\.php            [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$                            $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                              $1/category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6                                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$                                       $1/category\.php\?id=$2&brand=$3&page=$4                                                           [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$                                            $1/category\.php\?id=$2&brand=$3                                                                   [I]
RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$                               $1/category\.php\?id=$2                              [I]

RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$                                            $1/category\.php\?$4&id=$2&brand=$3

RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$                                  $1/goods\.php\?id=$2                                 [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5  [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)(.*)\.html$              $1/article_cat\.php\?id=$1&page=$2&keywords=$3   [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   $1/article_cat\.php\?id=$2&page=$3                   [I]
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$                            $1/article_cat\.php\?id=$2                           [I]
RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$                                $1/article\.php\?id=$2                               [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand\.php\?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand\.php\?id=$2&cat=$3&page=$4                  [I]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$                        $1/brand\.php\?$4&id=$2&cat=$3                  [I]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand\.php\?id=$2&cat=$3                          [I]
RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand\.php\?id=$2                                 [I]
RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search\.php\?keywords=$2                          [I]
RewriteRule ^(.*)/snatch-([0-9]+)\.html$                                     $1/snatch\.php\?id=$2                                [I]
RewriteRule ^(.*)/group_buy-([0-9]+)\.html$                                  $1/group_buy\.php\?act=view&id=$2                    [I]
RewriteRule ^(.*)/auction-([0-9]+)\.html$                                    $1/auction\.php\?act=view&id=$2                      [I]
RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$                             $1/exchange\.php\?id=$2&act=view                     [I]
RewriteRule ^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [I]
RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                         $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [I]
RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$                                          $1/exchange\.php\?cat_id=$2&page=$3  [I]
RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$                                                   $1/exchange\.php\?cat_id=$2  [I]

 

第五步:开启ecshop伪静态

登陆ecshop后台在系统设置-->商店设置-->基本设置里面的URL重写开启伪静态。