[program:laravel.default]
directory=/mnt/www/abroad
command=php artisan queue:work
autostart=true
autorestart=true
注意[program: 字样不能修改
[program:laravel.default]
directory=/mnt/www/abroad
command=php artisan queue:work
autostart=true
autorestart=true
注意[program: 字样不能修改
| PHP Driver | MongoDB 4.0 | MongoDB 3.6 | MongoDB 3.4 | MongoDB 3.2 | MongoDB 3.0 | MongoDB 2.6 |
|---|---|---|---|---|---|---|
| PHPLIB 1.4 + mongodb-1.5 | ✓ | ✓ | ✓ | ✓ | ✓ | |
| PHPLIB 1.3 + mongodb-1.4 | ✓ | ✓ | ✓ | ✓ | ✓ | |
| PHPLIB 1.2 + mongodb-1.3 | ✓ | ✓ | ✓ | ✓ | ||
| PHPLIB 1.1 + mongodb-1.2 | ✓ | ✓ | ✓ | ✓ | ||
| PHPLIB 1.0 + mongodb-1.1 | ✓ | ✓ | ✓ | |||
| mongodb-1.0 | ✓ | ✓ |
# 创建中间件
php artisan make:middleware EnableCrossRequestMiddleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class EnableCrossRequestMiddleware
{
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$origin = $request->header('Origin');
if ($origin) {
$exps = [
'/.*\.xxx\.com$/', # 匹配下自己的域名
'/.*localhost.*/',
'/.*127.0.0.1.*/',
'/.*10.*/',
];
foreach ($exps as $exp) {
$matchCount = preg_match($exp, $origin, $matches);
if ($matchCount && isset($matches[0])) {
if ($request->isMethod('OPTIONS')) {
$response = response('');
$response->withHeaders([
'Access-Control-Allow-Credentials' => 'true',
'Access-Control-Allow-Origin' => $origin,
'Access-Control-Allow-Methods' => 'GET, POST',
'Access-Control-Allow-Headers' => 'Content-Type, Token',
'Access-Control-Max-Age' => 3600 * 24,
]);
return $response;
}
$response = $next($request);
$response->withHeaders([
'Access-Control-Allow-Credentials' => 'true',
'Access-Control-Allow-Origin' => $origin,
]);
return $response;
}
}
}
return $next($request);
}
}
另外需要关闭csrf保护否则会413
cmd: set http_proxy=127.0.0.1:1080 powershell: $env:http_proxy="127.0.0.1:1080" $env:https_proxy="127.0.0.1:1080"
http_proxy 用于http链接
https_proxy 用于https链接
opcache.file_cache string
配置二级缓存目录并启用二级缓存。 启用二级缓存可以在 SHM 内存满了、服务器重启或者重置 SHM 的时候提高性能。 默认值为空字符串 “”,表示禁用基于文件的缓存。



是for循环占用了内存

貌似真的变大了
不是错觉 真的会变大
$std = new stdClass();
$std->a = 1;
foreach ($std as $key => $item) {
$name = "呵呵{$key}";
$std->$name = $item + 1;
}
$json = preg_replace('/[[:cntrl:]]/', '', $json);
# 把控制字符干掉就好了
# 实践证明,会把换行符也干掉。。。