magento 环境安装
1. 运行环境下载 wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.zip
2. magento1.8 官网下载
二.安装步骤
1. 安装 wampserver
2. 配置 wampserver 的虚拟主机
由于magento的后台登录不能使用localhost,这里就使用虚拟主机来解决这个问题。
2.1 配置 httpd.conf
文件路径:C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
开启虚拟主机的功能
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.2 配置 httpd-vhosts.conf
文件路径:C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
配置两个虚拟主机
<VirtualHost *:80>
DocumentRoot "D:/WebSite/phptest1"
ServerName www.phptest1.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/WebSite/phptest2"
ServerName www.phptest2.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2.3 修改 hosts
文件路径:C:\Windows\System32\drivers\etc\hosts
在后面增加:
127.0.0.1 www.phptest1.com
127.0.0.1 www.phptest2.com
重新启动 wampserver 即可
3. 解压magento1.8 到 D:/WebSite/phptest1
现在开始研究manento,安装环境遇到一些问题,成功之后把步骤记录下来,供有需要的朋友和自己以后参考。
1. 运行环境下载 wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.zip
2. magento1.8 官网下载
二.安装步骤
1. 安装 wampserver
2. 配置 wampserver 的虚拟主机
由于magento的后台登录不能使用localhost,这里就使用虚拟主机来解决这个问题。
2.1 配置 httpd.conf
文件路径:C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
开启虚拟主机的功能
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.2 配置 httpd-vhosts.conf
文件路径:C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
配置两个虚拟主机
<VirtualHost *:80>
DocumentRoot "D:/WebSite/phptest1"
ServerName www.phptest1.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/WebSite/phptest2"
ServerName www.phptest2.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
2.3 修改 hosts
文件路径:C:\Windows\System32\drivers\etc\hosts
在后面增加:
127.0.0.1 www.phptest1.com
127.0.0.1 www.phptest2.com
重新启动 wampserver 即可
3. 解压magento1.8 到 D:/WebSite/phptest1
4. 在IE浏览器中输入 www.phptest1.com
三.总结
之前安装了AppServ Php运行环境,下载的版本比较高,PHP的版本是6.0,而6.0已经废弃了函数 get_magic_quotes_gpc(),导致magento无法运行,在网上找了写方法,还是有问题,于是有下载了一个低一点的版本,结果在安装时,配置数据库用户名,密码时,一直无法通过,又在网上找了很久,还是没有解决。于是放弃了AppServ运行环境。
安装Wamp后,可以正常安装magento(magento安装在 c:\\wamp\www\下),但是无法进屋后台,即使输入127.0.0.1/index.php/admin 已经无法登录到后台。
后来想试试虚拟主机的配置(阿里云的虚拟主机也是这样配置的吧),结果使用虚拟主机可以访问网站后台,这让我一天的郁闷一下子就一扫而空。