magento2.3.5 安装与优化过程

admin5年前IT技术1131

 bin/magento setup:install --base-url=https://www.mytinely.com/ \

--db-host=localhost --db-name=mytinely \
--db-user=mytinely --db-password=mytinely \
--admin-firstname=Magento --admin-lastname=User --admin-email=root@shengmake.net \
--admin-user=admin --admin-password=admin --language=en_US \
--currency=USD --timezone=America/Chicago --cleanup-database \
--sales-order-increment-prefix="ORD$" --session-save=db --use-rewrites=1 
 
 
 
bin/magento cache:clean
bin/magento deploy:mode:show 
bin/magento deploy:mode:set production
bin/magento deploy:mode:set developer
bin/magento setup:static-content:deploy
 
 
生产模式将清空以下目录
var/cache
generated/metadata
generated/code
var/view_preprocessed
pub/static
 
 
将Magento部署到生产服务器时,以生产模式运行。优化服务器环境(例如数据库和Web服务器)之后,您应该运行静态视图文件部署工具以将静态视图文件写入Magentopub/static目录。
 
如果您在Magento Admin中启用了静态视图文件合并,则pub/static目录系统必须可写。
 
 
 
 
需要在PHP控制里删除exec函数,然后重启PHP函数
 
 
 
exec function is disabled
Categories 系统管理员2017年11月30日
 
在安装完 Magento 2.2.1 后,执行 php bin/magento deploy:mode:set production 后出现错误
 
...
exec function is disabled
 
php 的 exec 用于执行外部程式,类似功能的还有 passthru()、system()、 shell_exec()
 
如果要使用他们,需要找到 php.ini 中的
 
disable_functions =
 
如果 “disable_functions=” 后面有接上面四个函数,将其删除。默认 php.ini 配置文件中是不禁止你调用执行外部命令的函数的。但是一键安装包就不一定了。
sudo chmod -R 777 var
 
 
 
1.下载magento-ce-2.3.5-p2_sample_data-2020-07-27-09-17-19.tar.gz
2.设置php7.3  memory_limit 1024MB 删除禁用函数里的exec 安装扩展 缓存管理   intl  xls等
3.安装mysql5.7  安装apache2.4
4.设置站点目录权限sudo chmod -R 777 /站点
5.命令安装bin/magento setup:install --base-url=https://127.0.0.1/ \
--db-host=localhost --db-name=magento \
--db-user=magento --db-password=magento \
--admin-firstname=Magento --admin-lastname=User --admin-email=kkk@example.com \
--admin-user=admin --admin-password=admin987654 --language=en_US \
--currency=USD --timezone=America/Chicago --cleanup-database \
--sales-order-increment-prefix="ORD$" --session-save=db --use-rewrites=1
 
7.设置为生产模式bin/magento deploy:mode:set production  .设置站点目录权限sudo chmod -R 777 /站点
8.设置静态bin/magento setup:static-content:deploy
9.设置为开发模式 bin/magento deploy:mode:set developer  .设置站点目录权限sudo chmod -R 777 /站点
11.设置优化方案 合并js css 设置缓存
12.设置为生产模式bin/magento deploy:mode:set production  .设置站点目录权限sudo chmod -R 777 /站点
13.设置静态bin/magento setup:static-content:deploy
14.清除缓存bin/magento cache:clean 
bin/magento indexer:reindex
bin/magento cache:flush
 
 
10.部署
    启用维护模式:bin/magento maintenance:enable
    更新数据库架构和数据 bin/magento setup:upgrade
    编译代码bin/magento setup:di:compile 不要在开发模式下运行生产命令 
    设置静态bin/magento setup:static-content:deploy
    清除缓存bin/magento cache:clean        
    退出维护模式:bin/magento maintenance:disable
  
优化系统,加快系统的运行速度
 
 
11.redis缓存
bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=127.0.0.1 --page-cache-redis-db=1
bin/magento setup:config:set --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-log-level=4 --session-save-redis-db=2
需要在开发者模式下进行,然后在设置生产模式,再生成静态--这一点很关键,直接影响加载的速度
检测命令
redis-cli monitor
redis-cli ping
 
 
 
12.安装之前的编译
bin/magento module:enable --all
bin/magento setup:di:compile
bin/magento cache:clean
bin/magento maintenance:disable
 

相关文章

phptool phpfmt这两个插件会导致sublime出问题

 phptool 会让sublime产生垃圾文件phpfmt会导致sublime出死机,但是他能修正错误的PHP写法,要区别对待他,但是一个文件页面代码多了,他会导致sublime死机...

服务器2012打开远程端口,Windows Server 2012远程默认端口3389的修改

服务器2012打开远程端口,Windows Server 2012远程默认端口3389的修改

Window Server2012 修改远程桌面端口号Win + R 输入 regedit 打开注册表编辑器1、修改注册表项1HKEY_LOCAL_MACHINE/System/CurrentCont...

macbook安装window10 之后导致键盘P键失效与声卡没有声音的解决方案.

macbook安装window10 之后导致键盘P键失效与声卡没有声音解决方案:macbook启动的时候,同时按住command+r键,进入恢复模式大概20分钟之后,按键失效的问题就能解决了,如果声卡...

Ubuntu使用超级用户权限root

su认证失败刚刚装完Ubuntu后,root用户默认是被锁定的。此时我们在终端输入su会显示认证失败。解决方法Ubuntu安装完第一件事在终端输入sudo passwd root...

docker的感悟

1.容器是类实例化的对象,镜像是静态的类2.查看正在运行的容器docker ps ,查看所有容器包含停止与暂停的docker ps;3.拉去官方镜像:docker pull 镜像名称4.docker...

Android Studio4.1.3设置app全屏

 Android Studio4.1.3设置app全屏<style name="AppTheme.FullScreen">   ...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。