安装过程中发现php_mongodb.dll在php5.x中启动不了,在winodows下PHP版本要是PHP7,读者也可自行尝试在php5.x下安装php_mongodb.dll
github上redis只有对应x64版本的,PC系统是x86的需要自行编译redis源码
需要安装的软件:
wampserver_x86_3.0.6.exe :集成了PHP 7.0.10 、 apache2.4.23 和 mysql
php_mongodb.dll : mongodb的PHP扩展
php_redis.dll : redis的PHP扩展
Redis-x64-3.2.100 :版本分x64、x86
mongodb-win32-x86_64-2008plus-ssl-3.4.10-signed.msi :版本分x64、x86
1、安装WAMP:
下面地址,如果下面地址失效,自己百度wampserver 下载,wamp的安装路径为 : D:/wamp/
,可以修改 D:\wamp\bin\apache\apache2.4.23\conf\httpd.conf
将配置部分的代码
DocumentRoot "${INSTALL_DIR}/www/"
<Directory "${INSTALL_DIR}/www/">
修改为:
DocumentRoot "${INSTALL_DIR}/www/fecshop"
<Directory "${INSTALL_DIR}/www/fecshop/">
2、配置本地的host指向,参考官网链接:http://www.fecshop.com/doc/fecshop-guide/develop/cn-1.0/guide-fecshop-about-config.html
打开文件C:\Windows\System32\drivers\etc\hosts
,在文件的最后增加,
127.0.0.1 rock.fecshoptest.com # rockmongo的域名指向,rockmongo是mongodb的可视化界面,类似于mysql的phpmyadmin
127.0.0.1 my.fecshoptest.com # mysql的phpmyadmin的域名指向
127.0.0.1 appadmin.fecshoptest.com # 后台域名指向
127.0.0.1 appfront.fecshoptest.com # 前台pc端域名指向
127.0.0.1 appfront.fecshoptest.es # 前台pc端 es 语言的域名指向
127.0.0.1 apphtml5.fecshoptest.com # 前台html端的域名指向
127.0.0.1 appapi.fecshoptest.com # api端的域名指向
127.0.0.1 appserver.fecshoptest.com # server端的域名指向
127.0.0.1 img.fecshoptest.com #appimage/common 图片的域名指向
127.0.0.1 img2.fecshoptest.com #appimage/appadmin 图片的域名指向
127.0.0.1 img3.fecshoptest.com #appimage/appfront 图片的域名指向
127.0.0.1 img4.fecshoptest.com #appimage/apphtml5 图片的域名指向
127.0.0.1 img5.fecshoptest.com #appimage/appserver图片的域名指向
3.修改apache的配置
打开文件:wamp\bin\apache\apache2.4.23\conf\httpd.conf
文件:
将
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
修改为:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
参考:http://www.fecshop.com/doc/fecshop-guide/develop/cn-1.0/guide-fecshop-about-config.html
打开文件wamp\bin\apache\apache2.4.23\conf\ extra\httpd-vhosts.conf
文件,
上面的官方链接介绍的nginx的配置,下面是apache2根目录的文件路径配置:
# appfront.fecshoptest.com -> xxx/appfront/web
# appfront.fecshoptest.es -> xxx/appfront/web
<VirtualHost *:80>
ServerName appfront.fecshoptest.com
ServerAlias appfront.fecshoptest.es
DocumentRoot D:/wamp/www/fecshop/appfront/web
<Directory "D:/wamp/www/fecshop/appfront/web/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# appadmin.fecshoptest.com -> xxx/appadmin/web
<VirtualHost *:80>
ServerName appadmin.fecshoptest.com
ServerAlias appadmin.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appadmin/web
<Directory "D:/wamp/www/fecshop/appadmin/web/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# apphtml5.fecshoptest.com -> xxx/apphtml5/web
<VirtualHost *:80>
ServerName apphtml5.fecshoptest.com
ServerAlias apphtml5.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/apphtml5/web
<Directory "D:/wamp/www/fecshop/apphtml5/web/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# appapi.fecshoptest.com -> xxx/appapi/web
<VirtualHost *:80>
ServerName appapi.fecshoptest.com
ServerAlias appapi.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appapi/web
<Directory "D:/wamp/www/fecshop/appapi/web/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# appserver.fecshoptest.com -> xxx/appserver/web
<VirtualHost *:80>
ServerName appserver.fecshoptest.com
ServerAlias appserver.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appserver/web
<Directory "D:/wamp/www/fecshop/appserver/web/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# img.fecshoptest.com -> xxx/appimage/common
<VirtualHost *:80>
ServerName img.fecshoptest.com
ServerAlias img.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appimage/common
<Directory "D:/wamp/www/fecshop/appimage/common/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# img2.fecshoptest.com -> xxx/appimage/appadmin
<VirtualHost *:80>
ServerName img2.fecshoptest.com
ServerAlias img2.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appimage/appadmin
<Directory "D:/wamp/www/fecshop/appimage/appadmin/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# img3.fecshoptest.com -> xxx/appimage/appfront
<VirtualHost *:80>
ServerName img3.fecshoptest.com
ServerAlias img3.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appimage/appfront
<Directory "D:/wamp/www/fecshop/appimage/appfront/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# img4.fecshoptest.com -> xxx/appimage/apphtml5
<VirtualHost *:80>
ServerName img4.fecshoptest.com
ServerAlias img4.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appimage/apphtml5
<Directory "D:/wamp/www/fecshop/appimage/apphtml5/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# img5.fecshoptest.com -> xxx/appimage/appserver
<VirtualHost *:80>
ServerName img5.fecshoptest.com
ServerAlias img5.fecshoptest.com
DocumentRoot D:/wamp/www/fecshop/appimage/appserver
<Directory "D:/wamp/www/fecshop/appimage/appserver/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
4、安装php_mongodb.dll
下载php_mongodb.dll,下载地址:https://pecl.php.net/package/mongodb
下载最新的,目前(2017年11月29) 最新的链接是: https://pecl.php.net/package/mongodb/1.3.2/windows
查看phpinfo输出:
Compiler MSVC14 (Visual C++ 2015)
Architecture x86
Thread Safety enabled
Apache Version Apache/2.4.23 (Win32) PHP/7.0.10
在页面 https://pecl.php.net/package/mongodb/1.3.2/windows 的DLL List找到对应的版本:
7.0 Thread Safe (TS) x86
下载的文件为: php_mongodb-1.3.2-7.0-ts-vc14-x86.zip
把里面的文件php_mongodb.dll
放到D:\wamp\bin\php\php7.0.10\ext
目录下
D:\wamp\bin\php\php7.0.10\php.ini
extension=php_mongodb.dll
D:\wamp\bin\apache\apache2.4.23\bin\php.ini
5、安装redis的php扩展
https://pecl.php.net/package/redis
https://pecl.php.net/package/redis/3.1.4/windows
http://windows.php.net/downloads/pecl/releases/redis/3.1.4/php_redis-3.1.4-7.0-ts-vc14-x86.zip
redis扩展文件名 : php_redis.dll
, 同样是需要修改两处php.ini的配置
extension=php_redis.dll
安装redis:
redis下载:https://github.com/MicrosoftArchive/redis/releases ,是编译好的windows版本的redis ,只有x64版本可供下载,如果电脑是x86的系统需要自己下载源码编译
下载后解压:双击redis-server.exe就可直接启动redis
6、安装fecshop
百度云中下载最新fecshop:
https://pan.baidu.com/s/1hs1iC2C#list/path=/
参考:
http://www.fecshop.com/doc/fecshop-guide/develop/cn-1.0/guide-fecshop-about-hand-install.html
cd /d D:\wamp\www\fecshop
php init
[0] Development
输入0 回车
Initialize the application under 'Development' environment? [yes|no]
输入y 回车
7、修改store key
修改文件 D:\wamp\www\fecshop\appfront\config\fecshop_local_services\Store.php
把域名fecshop.appfront.fancyecommerce.com
替换成 appfront.fecshoptest.com
8、安装mongodb:
下载地址:https://www.mongodb.com/download-center
安装完mongodb,选择安装到D盘D:\Program Files
目录下,我的mongoDB安装在D:\Program Files
文件夹中。
在MongoDB的安装目录下,找到bin目录。
1)在目录下面新建文件夹 data,用于MongoDB数据库存放。
2)新建文件: mongodb.config,打开文件,在文件中写入:
dbpath=D:\Program Files\MongoDB\Server\3.4\bin\data
找开cmd控制台,执行下面命令:
cd /d D:\Program Files\MongoDB\Server\3.4\bin
mongod --config mongodb.config
9、安装完成
重启apache2,浏览器输入:http://appfront.fecshoptest.com/
就可以出现fecshop主页