magento 搭建

magento 搭建

1.安装apache 略

2.安装php
需要支持以下组件,php安装文件自带,php install file/ext/
Curl
ZIP
Zlib
GD Library
Mcrypt
Mbstrings
Xml

libxml2下载
http://linux.softpedia.com/get/Programming/Libraries/libxml2-162.shtml

CURL问题
yum install curl curl-devel

configure: error: png.h not found. GD的问题
yum install libpng
yum install libpng-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
https://sourceforge.net/projects/mcrypt/files/Libmcrypt/

yum -y install gd-devel zlib-devel libjpeg-devel libpng-devel libiconv-devel freetype-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libxslt-devel libmcrypt-devel mhash mcrypt

wget http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz
tar xf icu4c-52_1-src.tgz
cd icu/source
mkdir /usr/local/icu
./configure --prefix=/usr/local/icu
make && make install


php5
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/httpd/bin/apxs --with-libxml-dir=/usr/local/libxml2 --with-curl --with-zlib --with-mcrypt --with-openssl --with-mysql --with-pdo-mysql --enable-mbstring --enable-xml --enable-zip


安装错误
[ERROR] exception 'Exception' with message 'Warning: call_user_func() expects parameter 1 to be a valid callback, function 'imagecreatefromjpeg' not found or invalid function name in /usr/local/magento/vendor/magento/framework/Image/Adapter/Gd2.php on line 65' in /usr/local/magento/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'call_user_func(...', '/usr/local/mage...', 65, Array)


单独装gd
先装jpeg
http://www.ijg.org/files/jpegsrc.v9b.tar.gz
tar zxvf jpegsrc.v8d.tar.gz
cd jpeg-8d/
./configure --prefix=/usr/local/jpeg --enable-shared
make && make install

cd ../gd
phpize
./configure --with-jpeg-dir=/usr/local/jpeg --with-php-config=@php-config-path@
make clean
make && make install


单独装intl
--with-xsl
--enable-intl --with-icu-dir=/usr/local/icu/



开启apache rewrite模块
打开 httpd.conf 配置文件:去除 LoadModule rewrite_module modules/mod_rewrite.so 前面的 # 号。

将 AllowOverride 的值设定为 All, 并且特别注意取消RewriteBase前面的注释符号

最后要在magento后台开启搜索引擎优化功能: system->configuration->web->Search Engines Optimization->Use
Web Server Rewrites ->Yes


问题:后台资源文件404找不到

解决:
先把PHP.ini里的memory_limit放大到512
把magentor里的pub文件改名为pub.bak
手动生成资源文件:
/usr/local/php/bin/php bin/magento setup:static-content:deploy
完了在magentor里会出现一个新的pub文件

把这个pub文件改名为pub.bak2
再把前面的pub.bak改回成pub
cp -r pub.bak2/static/adminhtml pub/static/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值