Media files stored in the database

This section applies to you only if you store media files in the Magento database. This step should be performed before migration of data:

  1. Log in to the Magento 1 Admin Panel as an administrator.
  2. Click System > Configuration > ADVANCED > System.
  3. In the right pane, scroll to Storage Configuration for Media.
  4. From the Select Media Database list, click the name of your media storage database.
  5. Click Synchronize.

After that, use the following steps:

  1. Log in to the Magento 2 Admin as an administrator.
  2. Click Stores > Configuration > ADVANCED > System.
  3. In the right pane, scroll to Storage Configuration for Media.
  4. From the Select Media Database list, click the name of your media storage database.
  5. Click Synchronize.

Media files on the file system

All media files (for example, images for products, categories, the WYSIWYG editor, and so on) should be copied manually from <your Magento 1 install dir>/media to <your Magento 2 install dir>/pub/media.

However, do not copy .htaccess files located in the Magento 1 media folder. Magento 2 has its own .htaccess that should be preserved.

安装magento 2 simple data

这个是有难度的,看了几个教程,尝试过很多次才搞定。

我们用的是composer安装

执行这个命令,自动下载数据。记得把括号内更换成你的目录

php <your Magento install dir>/bin/magento sampledata:deploy

上面的过程中会让你输入magento key的。记得别忘记了。

 

下载完成以后执行下面命令安装 ,记得把括号内更改成你的目录

php <your Magento install dir>/bin/magento setup:upgrade

上面执行完了以后,可能有一个小错误提示,Please re-run Magento compile command 这个是可以忽略的。

这个时候就完成了测试数据的安装,可以打开首页看看。如果能打开那就一切正常。


如果打不开,那就看下边的内容:

全部执行以后,返回看你的网站,发现网站打不开了,这个时候搜索过很多,都没找到原因。

后来发现,重新执行了下权限命令,网站可以访问了。

我的用系统

  • Ubuntu: chown -R :www-data .

由于好奇开启了 Enable Javascript Bundling,Merge JavaScript Files,Minify JavaScript Files

导致后台很多功能都无法打开,前台paypal无法跳转

解决办法:从数据库入手

打开这表core_config_data ,将以下三项数值改为0.就关闭了这三项。

dev/js/merge_files

dev/css/merge_css_files

参考:http://magento.stackexchange.com/questions/80765/how-do-i-disable-merged-css-and-js

Mode name Description
default Enables you to deploy the Magento application on a single server without changing any settings. However, default mode is not optimized for production.

To deploy the Magento application on more than one server or to optimize it for production, change to one of the other modes.

  • Static view file caching is enabled
  • Exceptions are not displayed to the user; instead, exceptions are written to log files.
  • Hides custom X-Magento-* HTTP request and response headers
developer Intended for development only, this mode:

  • Disables static view file caching
  • Provides verbose logging
  • Enables automatic code compilation
  • Enables enhanced debugging
  • Shows custom X-Magento-* HTTP request and response headers
  • Results in the slowest performance (because of the preceding)
production Intended for deployment on a production system. Exceptions are not displayed to the user, exceptions are written to logs only, and static view files are served from cache only. New or updated files are not written to the file system.

以下内容来自谷歌翻译
magento 2 默认模式

使您无需更改任何设置部署一台服务器上的应用程序的Magento。然而,默认模式不用于生产优化。

到多个服务器上部署Magento的应用程序或优化其生产,换另一种模式。

静态视图文件缓存启用
例外不显示给用户;相反,异常将被写入日志文件。
隐藏定制的X Magento-* HTTP请求和响应头

magento 2 开发模式

仅用于开发,这种模式:
禁用静态视图文件缓存
提供详细的日志记录
启用自动代码编译
启用增强的调试
显示自定义X-Magento-* HTTP请求和响应头
结果最慢的性能(因为前面的)

magento 2 产品模式

用于在生产系统上部署。异常不显示给用户,例外仅写入日志和静态视图的文件被从仅高速缓存提供服务。新的或更新的文件不会被写入文件系统。

magento 2 模式转换

查看状态

php magento deploy:mode:show

开启产品模式:

magento deploy:mode:set production

开启开发模式

magento deploy:mode:set developer

 

In Magento 1.0, the configuration file that contains database settings and other information is located here:
/app/etc/local.xml

In Magento 2.0, the configuration is in the same directory (/app/etc/) but has been renamed to env.php. The file path is:

magento 2 数据库配置文件位置/app/etc/env.php

In this file, a number of key things are set, including the database connection information:

‘host’ => ‘localhost’,
‘dbname’ => ‘magento2database’,
‘username’ => ‘some-sample-username’,
‘password’ => ‘Extremely-Complicated-Password-12345’,
‘model’ => ‘mysql4’,
‘engine’ => ‘innodb’,
‘initStatements’ => ‘SET NAMES utf8;’,
‘active’ => ‘1’,

View indexer status查看索引状态

This command enables you to view the status of all or selected indexers (for example, shows whether indexers need to be reindexed).

Command options:

到magento 2根目录,然后cd bin文件,然后执行以下代码,

php magento indexer:status [indexer]

where [indexer] is a space-separated list of indexers. Omit [indexer] to view status of all indexers.

To view the list of indexers, enter

magento indexer:info

A sample follows:

magento indexer:status

Sample result:

Category Products:                                 Reindex required
Product Categories:                                Reindex required
Product Price:                                     Reindex required
Product EAV:                                       Reindex required
Stock:                                             Reindex required
Catalog Rule Product:                              Reindex required
Catalog Product Rule:                              Reindex required
Catalog Search:                                    Reindex required

Reindexing is discussed in the next section.

Reindex 执行索引

This command enables you to reindex all or selected indexers one time only.

This command reindexes one time only. To keep indexers up-to-date, you must set up a cron job.

Command options:

magento indexer:reindex [indexer]

where [indexer] is a space-separated list of indexers. Omit [indexer] to reindex all indexers.

To view the list of indexers, enter

magento indexer:info

A sample follows:

magento indexer:reindex

Sample result:

Category Products index has been rebuilt successfully in <time>
Product Categories index has been rebuilt successfully in <time>
Product Price index has been rebuilt successfully in <time>
Product EAV index has been rebuilt successfully in <time>
Stock index has been rebuilt successfully in <time>
Catalog Rule Product index has been rebuilt successfully in <time>
Catalog Product Rule index has been rebuilt successfully in <time>
Catalog Search index has been rebuilt successfully in <time>

创客读本

一本在线创客百科全书。本书主要服务于创客,内容涵盖Arduino、3D打印、无人机等创客知识。本书结合多媒体手段,图文并茂地讲述,知识来源于网络加上个人实践总结得来。欢迎批评指正。

电脑,手机均可阅读

网址:

  • www.makerbook.cn (创客读本的英文翻译)
  • www.chuangkeduben.com (创客读本拼音)

谁适合读这本书?

  1. 喜欢捣鼓的朋友,不论年龄大小;
  2. 学生,不管是大学生,中学生,还是小学生;
  3. 有新奇的点子,希望付诸实践的朋友

本书比印刷纸质书的优势

  • 本书完全免费
  • 在线图书可以提供丰富的多媒体资源,如:图片,视频,超链接,下载,讨论等
  • 本书不停地更新,不断完善,从读者的反馈中不断改进

读者QQ交流群:

  1. QQ群: 133851314

关键字

创客、Maker、Arduino、3D打印、开源硬件、智能小车、视频小车、循迹小车、蓝牙小车

谁写的创客读本

创客读本由创客VICTOR个人收集互联网上的相关资料,加上自我的实践学习,编辑而成。 email:[email protected]

研究了好久,搜索了很多东西都没找到结果。

后来无意中发现。命令

$ gitbook build ./How-to-Make-a-Computer-Operating-System-master --output=./testbook

先安装nodejs然后启动命令提示符,然后复制getbook对应书的文件下来到根目录,然后执行上面的命令,记得修改对应的文件名,就可以生成html文件了

MySQL has its own “query cache” that it uses in Magento to help generate dynamic pages and content while improving performance. These are some recommends settings for your my.cnf file.

query_cache_type = 1
query_cache_size = 32M
query_cache_limit=2M