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/
magento 搭建
猜你喜欢
转载自wen19851025.iteye.com/blog/2400244
今日推荐
周排行