nginx:
client_max_body_size 1G;
php.ini:
upload_max_filesize = 1G
post_max_size = 1G
nginx:
client_max_body_size 1G;
php.ini:
upload_max_filesize = 1G
post_max_size = 1G
$fp = fopen(sprintf("tmp/wk_exam_examination.%d.lock", $userid % 10), "w");
if (!flock($fp, LOCK_EX | LOCK_NB)) {
?>
<style>
#info {
text-align: center;
margin: 50px 0;
}
#info td {
font-size: 36px;
color: seagreen;
}
</style>
<div id='info'></div>
<script>
let sec = 5000
setTimeout(function () {
window.location.reload()
}, sec)
setInterval(function () {
sec -= 100
if (sec >= 0) {
let ok = sec / 1000
document.getElementById('info').innerHTML = `<table style="margin: 0 auto;">
<tr><td style='width: 50%; text-align: right;'>页面排队中...</td>
<td style="width: 2em; text-align: center;">${ok}</td><td>秒后将重试!</td></tr></table>`;
}
}, 100)
</script><?php
die;
}
queue:listen 是热加载,效率低,修改job类后会生效
queue:work 不会热加载,效率高,修改job类后需要重启才能生效
run __construct
run shutdown_function
run __destruct
* unset 等操作可以提前触发 __destruct
可以利用变量作用域在__destruct内来释放连接、解锁等释放操作
opcache.enable_cli + xdebug + swoole 可能会导致“段错误”(Segmentation fault)
[Symfony\Component\Process\Exception\ProcessTimedOutException] exceeded the timeout of 300 seconds.
解决办法:修改COMPOSER_PROCESS_TIMEOUT,默认是300秒,改大这个时间即可
# export COMPOSER_PROCESS_TIMEOUT=3600
# composer update