0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"theme": "dark",
"profiles": [{
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"acrylicOpacity": 0.7,
"colorScheme": "WildCherry",
"cursorColor": "#000000",
"fontFace": "Jetbrains Mono",
"useAcrylic": true,
"hidden": true
},
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"colorScheme": "WildCherry",
"historySize": 9001,
"snapOnInput": true,
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"commandline": "powershell.exe",
"fontFace": "Jetbrains Mono",
"fontSize": 12,
"acrylicOpacity": 0.8,
"useAcrylic": true,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": true,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
// "commandline": "bash",
"colorScheme": "PencilDark",
"source": "Windows.Terminal.Wsl"
}
],
"schemes": [{
"name": "WildCherry",
"black": "#000507",
"red": "#d94085",
"green": "#2ab250",
"yellow": "#ffd16f",
"blue": "#883cdc",
"purple": "#ececec",
"cyan": "#c1b8b7",
"white": "#fff8de",
"brightBlack": "#009cc9",
"brightRed": "#da6bac",
"brightGreen": "#f4dca5",
"brightYellow": "#eac066",
"brightBlue": "#308cba",
"brightPurple": "#ae636b",
"brightCyan": "#ff919d",
"brightWhite": "#e4838d",
"background": "#1f1726",
"foreground": "#dafaff"
},
{
"name": "Royal",
"black": "#241f2b",
"red": "#91284c",
"green": "#23801c",
"yellow": "#b49d27",
"blue": "#6580b0",
"purple": "#674d96",
"cyan": "#8aaabe",
"white": "#524966",
"brightBlack": "#312d3d",
"brightRed": "#d5356c",
"brightGreen": "#2cd946",
"brightYellow": "#fde83b",
"brightBlue": "#90baf9",
"brightPurple": "#a479e3",
"brightCyan": "#acd4eb",
"brightWhite": "#9e8cbd",
"background": "#100815",
"foreground": "#514968"
},
{
"name": "PencilDark",
"black": "#212121",
"red": "#c30771",
"green": "#10a778",
"yellow": "#a89c14",
"blue": "#004e6d",
"purple": "#523c79",
"cyan": "#20a5ba",
"white": "#d9d9d9",
"brightBlack": "#424242",
"brightRed": "#fb007a",
"brightGreen": "#5fd7af",
"brightYellow": "#f3e430",
"brightBlue": "#20bbfc",
"brightPurple": "#6855de",
"brightCyan": "#4fb8cc",
"brightWhite": "#f1f1f1",
"background": "#212121",
"foreground": "#f1f1f1"
}]
}

pdfplumber 这个库相对另外几个 解析出来的更容易理解,返回list,还可以将PDF中的表格形式返回给console

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- coding: utf-8 -*-
import pdfplumber
import datetime
import sys
import os


# 交互
try:
pdfName = input("输入PDF文件名:")
with pdfplumber.open(pdfName) as pdf:
first_page = pdf.pages[0]
print(len(pdf.pages))
i = 1
data = []
for page in pdf.pages:
for table in page.extract_tables():
if i % 2 == 0:
# print(i, table[1])
print(i, table[1][1])
# 判断qty是否是纯数字
if table[1][1].isdigit():
print('单sku和多数量的订单', table[1][0], table[1][1])
for x in range(int(table[1][1])):
data.append(table[1][0])
else:
# qty不是纯数字,多行文本会用\n链接
print('多个sku多数量的订单', table[1][0], table[1][1])
skuList = table[1][0].split('\n')
qtyList = table[1][1].split('\n')
# ['WF-DC-TAUPE-T', 'WF-DC-GREY-T'] ['2', '1']
print(skuList, qtyList)
for s in range(len(skuList)):
for q in qtyList[s]:
data.append(skuList[s])
i = i + 1
print(data)
with open("result.csv", "w", newline='\r\n') as file:
file.write('SKU' + '\n')
for v in data:
print(v)
file.write(v + '\n')
except Exception as valueError:
print('pdf文件错误:' + valueError)
# windows
os.system('pause')

lravel 5.8 使用jwt-auth,捕获异常

1
2
3
$this->middleware('jwt.auth', ['except' => ['login']]);
// 另外关于上面的中间件,官方文档写的是『auth:api』
// 但是我推荐用 『jwt.auth』,效果是一样的,但是有更加丰富的报错信息返回

会报错401,打印sql 发现是config\auth.php guards 需要设置为默认值为api,如果没有就会读取默认的tables查询user。着急,两种方法记录一下,日后在完善。
修改:

1
2
3
4
5
6
7
8
9
$this->middleware('auth:api', ['except' => ['login']]);
// 指定guards 为 api
'guards' => [
'api' => [
'driver' => 'jwt',
'provider' => 'admin_users',
'hash' => false,
],
]

修改\app\Http\Middleware\Authenticate.php,重写authenticate($request, array $guards)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* @param \Illuminate\Http\Request $request
* @param array $guards
* @return \Illuminate\Http\JsonResponse|void
* @throws AuthenticationException
*/
protected function authenticate($request, array $guards)
{
if (empty($guards)) {
$guards = [null];
}

foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
return $this->auth->shouldUse($guard);
}
}
if($guards[0]=='api'){
try
{
if (! $user = \JWTAuth::parseToken()->authenticate())
{
return response()->json([
'error' => true,
'code' => 10,
'data' => [
'message' => 'User not found by given token'
]
]);
}

} catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
return response()->json([
'error' => true,
'code' => 11,
'data' => [
'message' => 'Token Expired'
]
]);

} catch (TokenInvalidException $e) {
return response()->json([
'error' => true,
'code' => 12,
'data' => [
'message' => 'Invalid Token'
]
]);

} catch (JWTException $e) {
return response()->json([
'error' => true,
'code' => 13,
'data' => [
'message' => 'Token absent'
]
]);
}
}
throw new AuthenticationException(
'Unauthenticated.', $guards, $this->redirectTo($request)
);
}

也可以写在这里
\app\Exceptions\Handler.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
* @param Exception $exception
* @return mixed|void
* @throws Exception
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
* @param \Illuminate\Http\Request $request
* @param Exception $exception
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/
public function render($request, Exception $exception)
{
//也可以在这里写
// if ($exception instanceof AuthenticationException){
// $guard = $exception->guards()[0];
// if ($guard=='api'){
// $preException = $exception->getPrevious();
// return response()->json(['error' => 'TOKEN_INVALID']);
// }
// }
if ($exception instanceof UnauthorizedHttpException) {
$preException = $exception->getPrevious();
if ($preException instanceof
\Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['error' => 'TOKEN_EXPIRED']);
} else if ($preException instanceof
\Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['error' => 'TOKEN_INVALID']);
} else if ($preException instanceof
\Tymon\JWTAuth\Exceptions\TokenBlacklistedException) {
return response()->json(['error' => 'TOKEN_BLACKLISTED']);
}
if ($exception->getMessage() === 'Token not provided') {
return response()->json(['error' => 'Token not provided']);
}
}
return parent::render($request, $exception);
}
}

关键代码:https://stackoverflow.com/questions/47573258/writing-text-over-a-pdf-in-python3
python读取excel数据,添加到pdf对应的页面:
pyinstaller -F pdfWater 打包成 pdfWater.exe,文件名可以拖拽到窗口,效率还可以。60页pdf 3秒左右。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import xlrd
from datetime import datetime

from PyPDF2 import PdfFileWriter, PdfFileReader
import io
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
import os

import reportlab.pdfbase.ttfonts #导入reportlab的注册字体
reportlab.pdfbase.pdfmetrics.registerFont(reportlab.pdfbase.ttfonts.TTFont('song', 'SimSun.ttf')) #注册字体


# 交互
try:
excelName = input("输入excel文件名:")
# excel
# worksheet = xlrd.open_workbook(u'')
worksheet = xlrd.open_workbook(excelName)
sheet_names = worksheet.sheet_names()
print(sheet_names)

sheet = worksheet.sheet_by_name('Sheet1')
rows = sheet.nrows # 获取行数
cols = sheet.ncols # 获取列数
all_content = []
for i in range(rows):
if (i > 0): # 跳过第一行title
cell = sheet.cell_value(i, 2) # 取第二列数据
try:
all_content.append(cell)
except ValueError as e:
pass
print(all_content)
except Exception as ValueError:
print('Excel文件错误:'+ValueError)
# windows
os.system('pause')


try:
pdfName = input("输入pdf文件名:")
# pdf
# read your existing PDF
existing_pdf = PdfFileReader(open(str(pdfName), "rb"))
output = PdfFileWriter()
except Exception as ValueError:
print('Pdf文件错误:'+ValueError)
os.system('pause')


try:
fontSize = int(eval(input("输入字号:")))
if(fontSize < 10):
print("不能小于10:"+fontSize)
except:
print("输入有误,默认为17")
fontSize = 17
finally:
print('Finally fontSize:'+str(fontSize))

try:
outFile = input("生成的pdf文件名(默认2019-01-01.pdf):")
if outFile == "":
outFile = datetime.now().date().strftime('%Y-%m-%d')+".pdf"
print(outFile)
except EOFError:
print("输入有误,默认为日期文件名")
# windows
os.system('pause')


try:
for index in range(len(all_content)):
packet = io.BytesIO()
# create a new PDF with Reportlab
can = canvas.Canvas(packet, pagesize=letter)
# can.setFontSize(fontSize)
can.setFont('song',fontSize) #设置字体字号
can.setFillColorRGB(1, 0, 0) # choose your font colour
can.drawString(2, 200, all_content[index])
can.save()

# move to the beginning of the StringIO buffer
packet.seek(0)
new_pdf = PdfFileReader(packet)

# 获取PDF文件的页数
pageNum = existing_pdf.getNumPages()
print('ID:' + str(index+1) + ', pdfPageNum:' +
str(index+1) + ', excelLine:' + all_content[index])

# 给每一页打水印
page = existing_pdf.getPage(index)
page.mergePage(new_pdf.getPage(0))
output.addPage(page)

packet.close
packet.flush

# finally, write "output" to a real file
outputStream = open(outFile, "wb")
output.write(outputStream)
outputStream.close()

# windows
os.system('pause')
except Exception as err:
print("程序错误:" + err)

# windows
os.system('pause')

Install:

1
2
3
4
php bin/magento setup:upgrade
php bin/magento index:reindex
php bin/magento cache:clean
php bin/magento setup:di:compile

0、#parallax 上传图片文件名不能带有中文#,如果不小心上传了带有中文的,直接操作数据库,清空parallax_block、、parallax_block_item、parallax_block_store 的三个表的数据。重新登陆后台。

1、logo、title、keywords、description 设置

1
Stores->Configuration->Templatemonster->Theme Option->General

2、shop by brand 设置

1
Stores->Configuration->Templatemonster->Shop by Brand

3、产品地区Product manufacturer 设置

1
2
Stores->Product Attributes->country_of_manufacturer->Storefront Properties->use in search
Stores->Product Attributes->manufacturer->Storefront Properties->use in search

4、导航栏样式bug,(二级导航没有padding):

需要开启 stores->templatemonster->megamenu->megamenu conifg->enable/disable->enable

5、magento 2.3.3 templatemonster->sliders->上传图片bug:

1
/vendor/magento/framework/App/Filesystem/Directory Resolver.php:56

#需要先上传一张产品图片可以解决此bug

6、footer 图标代码

1
2
3
4
5
6
<ul class="list-icon">
<li><a target="_blank" href="https://www.facebook.com/gogo"><i class="fa fa-facebook"></i></a></li>
<li><a target="_blank" href="https://twitter.com/gogo"><i class="fa fa-twitter"></i></a></li>
<li><a target="_blank" href="https://www.instagram.com/gogoo/"><i class="fa fa-instagram"></i></a></li>
<li><a target="_blank" href="https://www.youtube.com/channel/UCa1rPny7EUJGgVx6MEc7oog"><i class="fa fa-pinterest"></i></a></li>
</ul>
1
2
3
4
5
6
7
<ul class="list-footer">
<li><a target="_blank" href="#"><i class="fa fa-cc-visa"></i></a></li>
<li><a target="_blank" href="#"><i class="fa fa-cc-mastercard"></i></a></li>
<li><a target="_blank" href="#"><i class="fa fa-cc-paypal"></i></a></li>
<li><a target="_blank" href="#"><i class="fa fa-cc-discover"></i></a></li>
<li><a target="_blank" href="#"><i class="fa fa-cc-stripe"></i></a></li>
</ul>

7、自定义js文件不加载

本地安装2.3.2+theme 没有问题。在服务器 2.3.3 + theme 出现requirejs-config.js 已经包含自定义js文件并编译成功,但是没加载自定js文件。
解决方法:直接在theme自带的theme.js文件添加js…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
define([
'jquery.countdown'
], function ($) {
'use strict';

// custom js start
// alert("page loaded!");
// var $date = $("#clock").attr('data-id');
// $('#clock').countdown($date, function(event) {
// $(this).html(event.strftime('%D days %H:%M:%S'));
// });
// custom js end
var $date = $("#clock").attr('data-id');
var $current = new Date();
var $old = new Date($date);
if($current.getTime()>$old.getTime()){
$("#clock").css("display","none");
}else{
$('#clock').countdown($date, function(event) {
$(this).html(event.strftime('%D days %H:%M:%S'));
});
}
});
// custom js end

magento 2.3.2 + theme
lnmp 1.6
centos 7.2 + nginx + php 7.2.29 + mysql 5.7.29 + redis

nexcess 权限:

文件权限:find code -type f -exec chmod 0600 {} ;
文件夹权限:find code -type d -exec chmod 0711 {} ;

常用命令:

php bin/magento indexer:reindex 重建缓存
php bin/magento cache:clean && php bin/magento cache:flush 清除缓存
php bin/magento setup:static-content:deploy -f 编译资源
bin/magento deploy:mode:show 查看当前运行模式
bin/magento deploy:mode:set {mode} [-s|–skip-compilation] 设置运行模式
bin/magento deploy:mode:set default
bin/magento deploy:mode:set developer
bin/magento deploy:mode:set production
php bin/magento admin:user:unlock ADMINUSERNAME

问题一:

error 详细错误:
“There has been an error processing your request. Exception printing is disabled by default for security reasons.”
修改#app/bootstrap.php#

1
2
3
4
5
6
/**
* Environment initialization
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
$_SERVER['MAGE_MODE'] = 'developer';

问题二:

setup 403 错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
location /setup {
root $MAGE_ROOT;
location ~ ^/setup/index.php {

### This fixes the problem:
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
################################

fastcgi_pass fastcgi_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ ^/setup/(?!pub/). {
deny all;
}

location ~ ^/setup/pub/ {
add_header X-Frame-Options "SAMEORIGIN";
}
}

问题三:

In developer Magento mode Warning is shown on the Search Terms page:

Warning: natcasesort() expects parameter 1 to be array, null given in /var/www/html/deployer/instances/i-25245-2-3-develop/app/code/Magento/Search/Block/Term.php on line 102 [] []

文件位置不同:/home/wwwroot/www.test.develop/vendor/magento/module-search/Block/Term.php

1
2
3
4
+   $termKeys = []; //add
$this->_maxPopularity = reset($terms)->getPopularity();
$this->_minPopularity = end($terms)->getPopularity();
$range = $this->_maxPopularity - $this->_minPopularity;

问题四:

Consumer “async.operations.all” skipped as required connection “amqp” is not configured. Unknown connection name amqp

If you don’t want to use the Magento Message Queues, you can just disable it.

1
php bin/magento module:disable Magento_Amqp

If you want to use it, you might modify your app/etc/env.php

1
2
3
4
5
6
7
8
9
10
11
<?php
return [
// ...
'cron_consumers_runner' => [
'cron_run' => false,
'max_messages' => 1000,
'consumers' => [
'async.operations.all',
]
]
]; // return closing

问题五:

主题安装完后台缺少js文件,Magetique 2.2 主题

https://www.xxx.com/admin/filmslider/slider/
查看 pub/staic 文件夹为空,重新生成pub/static文件夹中的CSS文件

1
php bin/magento setup:static-content:deploy

问题六:

添加自定义js
在Magento 2添加自定义JS文件的步骤:
创建文件 /app/design/frontend/TemplateMonster/theme007/Magento_Theme/web/js/main.js,主题目录

1
2
3
4
5
6
7
8
9
define([
'jquery',
"jquery.countdown"
], function ($) {
'use strict';
$(function () {
alert("Page loaded.");
});
});

修改文件 /home/wwwroot/www.test.develop/app/design/frontend/TemplateMonster/theme007/Magento_Theme/requirejs-config.js:

1
2
3
4
5
6
7
8
var config = {
    paths: {
"main": 'js/main',
},
shim: {
'main': ['jquery']
},
};

控制台清空缓存,清空浏览器缓存。

执行命令:

1
2
php bin/magento cache:clean && php bin/magento cache:flush
php bin/magento setup:static-content:deploy -f

#本地安装2.3.2+theme 没有问题。在服务器 2.3.3 + theme 出现requirejs-config.js 已经包含自定义js文件并编译成功,但是没加载自定js文件。直接在theme.js文件添加js…
#解决方法:直接在theme自带的theme.js文件添加js…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// custom js start
// alert("page loaded!");
var $date = $("#clock").html();
var $current = new Date().;
var $old = new Date($date);
if($currentd1.getTime()>$old.getTime()){
$('#clock').countdown($date, function(event) {
$(this).html(event.strftime('%D days %H:%M:%S'));
});
}else{
$("#clock").css("display","none");
}

// custom js end

问题七:

产品比较 magento 2.3.3 点击compare不显示对比内容,bug 为处理,删除该功能

1
2
3
4
5
6
<!-- remove 20191129 -->
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true" />
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="view.addto.wishlist" remove="true" />

问题八:

当前激活的导航栏项目没有active 激活状态,只能激活一次就被缓存,只能关闭full page cache,但是会影响性能。magento 2.3.3 bug 未修复,暂时关闭该效果。

Magento\Theme\Block\Html\Topmenu::_getMenuItemClasses()
注释这几行:

1
2
3
4
5
// if ($item->getIsActive()) {
// $classes[] = 'active';
// } elseif ($item->getHasActive()) {
// $classes[] = 'has-active';
// }

问题九

遍历 referenceBlock的name属性 可以关闭部分magento 的不需要显示的功能模块。

/app/design/frontend/TemplateMonster/theme007/Magento_Theme/layout
关闭对比功能和愿望清单

1
2
3
4
5
6
7
8
9
10
11
12
13
<!-- remove 20191129 -->
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true" />
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="view.addto.wishlist" remove="true" />
<referenceBlock name="product.info.review" remove="true" />
<!-- Remove compare -->
<referenceBlock name="catalog.compare.link" remove="true" />
<referenceBlock name="catalogsearch.product.addto.compare" remove="true"/>
<referenceBlock name="crosssell.product.addto.compare" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="upsell.product.addto.compare" remove="true" />

问题10

更改product detail 里的 short description 位置:
修改文件:app\design\frontend\TemplateMonster\theme007\Magento_Catalog\layout\catalog_product_view.xml
修改 after=”product.info.price” 属性 after=”product.info.options.wrapper”,属性值可以用 referenceBlock的遍历程序遍历出的列表里查找。

1
<move element="product.info.overview" destination="product.info.main" after="product.info.options.wrapper"/>

问题11

在定义表格时,width(整个表格的宽度)不要设置为固定数值,定义为百分比类型,例如90%或者95%;再追加style=”table-layout:fixed;”,这样做可以使半角连续字符强制换行,不至于撑破列宽。需要注意的是,使用此参数后,不要轻易在tr(行)或td(列)中加入height属性,会使table不再被内容撑出适合的高度。

1
<table style="table-layout: fixed;" border="1" width="100%" cellspacing="0" cellpadding="2">

问题12

nexcess 主机迁移到本地做开发环境,注意mysql版本,nexcess 文件和文件夹权限。

Set Unsecure URL

1
bin/magento setup:store-config:set --base-url="http://www.magento2.com/"

Set Secure URL

1
bin/magento setup:store-config:set --base-url-secure="https://www.magento2.com/"

Clear Cache

1
bin/magento cache:flush

权限:

1
2
find /var/www/my_website -type d -exec chmod 0755 {} \;
find /var/www/my_website -type f -exec chmod 0644 {} \;

迁移后可能遇到:vendor\magento\framework\Encryption\Encryptor.php
加密方式问题,注释掉:

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
* Gets latest hash algorithm version.
*
* @return int
*/
public function getLatestHashVersion(): int
{
// if (extension_loaded('sodium') && defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
// return self::HASH_VERSION_ARGON2ID13;
// }

return self::HASH_VERSION_SHA256;
}

创建新用户

1
php bin/magento admin:user:create

复制新用户密码给原有用户。

将配置信息添加到/etc/mail.rc文件末尾。

1
2
3
4
5
6
7
8
9
10
11
# send email
set from=XXXXXX@163.com
set smtp=smtp.163.com:25
set smtp-auth=login
# 授权用户
set smtp-auth-user=XXXXXX@163.com
# 授权密码
set smtp-auth-password=123456
# 忽略验证
set ssl-verify=ignore
set nss-config-dir=/etc/maildbs/

echo “这是会议中的一份记录” | mail -s “会议记录” -a /home/wwwlogs/www.hebeidali.com_20190228.log.gz 2757983886@qq.com

作者:房昊
链接:https://www.zhihu.com/question/41469358/answer/494572759
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

其实不用等成佛之后再问猴子的下场,神妖大战之后,花果山已经被天庭放火烧过,残山剩水,仅有几只泼猴。
这里边没有法力的,被猎人捉走,偶尔有几只身负法力,也会被天庭派人监管起来。

孙悟空被压在五指山下五百年,这群猴子就在花果山里苦苦熬了五百年。

Weiterlesen »

作者:房昊
链接:https://www.zhihu.com/question/43344428/answer/486009370
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

很多年以后,报仇的孙猴子回想往事,那条取经路是这样的:

·1
那年我还很年轻,最看不得不平事,无论对方是谁,我抄起棍子就能打。

放红尘里,这种年轻人被社会摩擦几年,迟早安分,奈何人年轻的时候,是不会这样想的,他们都会想老子天下第一,三界大可去得。

更何况,我还名叫孙悟空。

Weiterlesen »

作者:房昊
链接:https://www.zhihu.com/question/42914827/answer/237599735
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

·1
很久以前,那时候我还年轻,三界之中尚没有我的名字。

如果非要说有,那也行,一般都叫我孽障,再加多几个定语,便是玉帝他妹妹私通凡人生下来的孽障。

Weiterlesen »