一. 添加常用软件库
- 
添加 Remi 库
Remi 主打 php 及相关扩展, 所以安装 php 这个库是不二选择.
首先进入 Remi 网站, 在 Maintained Enterprise Linux (RHEL / CentOS / Other clones) 列表中找到 Enterprise Linux 8 项后面的 remi-release-8.rpm , 执行下面的命令安装.
| 1 | dnf install http://rpms.remirepo | 
 
			
			
									
			
			
	Remi 主打 php 及相关扩展, 所以安装 php 这个库是不二选择.
首先进入 Remi 网站, 在 Maintained Enterprise Linux (RHEL / CentOS / Other clones) 列表中找到 Enterprise Linux 8 项后面的 remi-release-8.rpm , 执行下面的命令安装.
| 1 | dnf install http://rpms.remirepo | 
服务器环境
DigitalOcean VPS , CentOS 7 + LNMP
WordPress 已经有众多加速插件, 效果都还不错. 大多采用生成静态页面文件的方式. 对数据库的加速能力有限.
Redis 是一种内存数据库, 用它为 mysql 做缓存, 可有效加速数据库查询速度.
在使用 Redis 之前要先安装 Redis 和 php redis 扩展
| 1 2 3 | yum install redis php-pecl-redis systemctl enable redis systemctl start redis | 
配置 redis
CentOS 7 与前代相比有了巨大改变, 服务管理器, 时间设置等等, 对于习惯了前代版本的人来说还是需要时间适应的.
下面讲一下如何从头配置 CentOS 生产环境, 以 DigitalOcean 云主机为例, 有关此云主机的介绍 请点这里
CentOS 7 为64位系统, 最低内存要求512M.
Remi 主打 php 及相关扩展, 所以安装 php 这个源是不二选择.
首先进入 Remi 网站, 在 Maintained Enterprise Linux (RHEL / CentOS / Other clones) 列表中找到 Enterprise Linux 7 项后面的 remi-release-7.rpm… 阅读全文 
Magento 默认不会显示错误提示, 通常会显示一个空白页. 若要启用 Magento 的调试模式, 有两种方式:
| 1 | SetEnv MAGE_IS_DEVELOPER_MODE TRUE | 
如图

| 1 2 3 4 | if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {     Mage::setIsDeveloperMode(true); } | 
将外面的 if 判断注释掉, 保存即可.… 阅读全文
对于Magento 版本1.4.1.1版本来说,可能会导致产品无法添加到购物车页面,提示错误cannot add item to shopping cart。
这个错误会在如下的条件下产生
1 客户没有登录( The user is not logged in)
2 商店设置了购物车打折规则(There is a shopping cart rule)
3 使用非Magento默认的支付方式 (There are only non default Magento payment methods).
修正的方法如下:
找到 app/code/core/Mage/Sales/Model/Quote/Payment.php 文件 ,修改第115行,_beforeSave()这个方法改成:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | protected function _beforeSave() {     if ($this->getQuote())     {         $this->setQuoteId($this->getQuote()->getId());     }     try     {         $method = $this->getMethodInstance();     }     catch (Mage_Core_Exception $e)     {         return parent::_beforeSave();     }     $method->prepareSave();     return parent::_beforeSave(); } |