问题

I write a simple web application for my compnay that can let user log in to arrange their work time. Besides, user can also view the report of he's or she's attandence that I use ajax to callback from java.jar. (We use java to analyze)I use Xampp to set up the server in virtual machine HyperV and it can run successfully at the begining but after twenty hours or more than one day it won't let anyone to log in.

I open the error.log shows that :

PHP Fatal error: Could not queue new timer in Unknown on line 0

. . . and than:

PHP Warning: mysqli_connect(): (HY000/2002): Unknown Error

I don't understand what can cause that happend and how to solve it.

I alreday know is when I restarted the apache server, it can still be used till that error happened.

My System Enviroment :

win7 64 bit HyperV

xampp Apache/2.4.18, php/7.0.6, mysql/ 5.1

Here is my code:

mysql_start.php

header("Content-Type:html;charset=utf-8");

$servername = "127.0.0.1";

$username = "root";

$password = "cc1234";

$dbname = "cc_tw000427";

$conn = null;

try {

$conn = new mysqli($servername, $username, $password, $dbname);

} catch (Exception $e) {

$error_message = "Connect Error (" .$conn->connect_errno ." )" . $conn->connect_error;

error_log($error_message, 3, "php_error_log");

header("location:login.php?err=$e");

}

$conn->set_charset("utf-8");

$strDBColLoingAccount = "AccountID";

checklogin.php

session_start();

include_once("mysql_start.php");

$yid = trim(filter_input(INPUT_POST, "yid"));

$passd = trim(filter_input(INPUT_POST,"passd"));

$strSql = "SELECT acc.*, b.String_10_1 FROM basicstoreinfomanageacc_sub acc,basicstoreinfo b

WHERE acc.$strDBColLoingAccount ='$yid' AND acc.String_50_1 = b.String_50_1";

$result = $conn->query($strSql);

$n = $result->num_rows;

if ($n == 0) {

header("Location:../desktop/login.php?err=1");

echo "Error 1";

exit();

}

while ($row = $result->fetch_assoc()) {

$passd_right = $row["AccountPwd"];

$user_id = $row["AccountID"];

$user_name = $row["AccountName"];

$user_dep_id = $row["String_10_1"];

$user_dep = $row['String_50_1'];

}

$result->close();

if (($passd_right == "") || ($passd_right == NULL)){

session_start();

$_SESSION['user_id'] = $user_id;

$_SESSION['user_name'] = $user_name;

header("location:newpwd.php");

exit();

}

if ($passd == $passd_right) {

$_SESSION['user_id'] = $user_id;

$_SESSION['user_name'] = $user_name;

$_SESSION['loginOK'] = 'yes';

$_SESSION['year_i'] = date('Y',time());

$_SESSION['year_f'] = date('Y',time());

$_SESSION['month_i'] = date('m',time());

$_SESSION['month_f'] = date('m',time());

$_SESSION['day_i'] = date('d',time());

$_SESSION['day_f'] = date('d',time());

$_SESSION['Hour'] = date('Y-m-d G:i:s',strtotime('+6 hour'));

$_SESSION['user_dep_id'] = $user_dep_id;

$_SESSION['user_dep'] = $user_dep;

header("Location:../desktop/Punch.php");

} else {

header("Location:../desktop/login.php?err=1");

}

$conn->close();

?>

Next two *.php files are used to receive the post from the web.

The select.php is used to select the data from mysql than output in html tag.

The save.php is used to save the data post from web.

select.php

session_start();

include_once '../control/mysql_start.php';

$strYear = $_POST['year'];

$strMonth = $_POST['month'];

$strDay = $_POST['day'];

.

.//some codes

.

$strSql = "SELECT * FROM basicemploymentinfo bei WHERE bei.BelongStore = '". $_SESSION['user_dep']."'".

"AND ((bei.datetime_2 is null AND bei.datetime_3 is null) OR (bei.datetime_2 is null AND bei.datetime_3 >= STR_TO_DATE('" . $strDate . "', '%Y-%m-%d'))" .

" OR (bei.datetime_2 <= STR_TO_DATE('" . $strDate . "', '%Y-%m-%d') AND bei.datetime_3 is null)" .

" OR (bei.datetime_2 <= STR_TO_DATE('" . $strDate . "', '%Y-%m-%d') AND bei.datetime_3 >= STR_TO_DATE('" . $strDate . "', '%Y-%m-%d'))) "

."AND bei.Active ='Y'";

$EmpId = array();

$EmpName = array();

if ($result = $conn->query($strSql)) {

while($row = $result->fetch_assoc()) {

array_push($EmpId, $row['String_20_1']);

array_push($EmpName, $row['String_20_2']);

.

.//some codes

.

}

}

$Emp = array_combine($EmpId, $EmpName);

$strSql = " SELECT Distinct date_format(DateTime_1, '%e') as date, AutoCheck

FROM hrotcheck

WHERE date_format(DateTime_1, '%Y-%m-%d') = '$newformat'

AND AutoCheck = 'C'

AND String_20_1 IN ($array_emp_id)";

if ($result = $conn->query($strSql)) {

$n = $result->num_rows;

if ($n > 0) { $checkboxVerify = 'C';}

}

$result->close();

foreach ($Emp as $EId => $EName)

{

.

.//some codes

.

$strSql = "SELECT RegularM_1, RegularM_2, FORMAT(OT_3, 1) as OT_3, TOM, TOTM, Notes, AutoCheck FROM hrotcheck where string_20_1 = '" . $EId . "' AND"." date_format(DateTime_1,'%Y-%m-%d') = '$newformat'";

$result = $conn->query($strSql);

if ($result->num_rows > 0) {

while($row = $result->fetch_assoc()) {

$RegularM_1 = $row['RegularM_1'];

$RegularM_2 = $row['RegularM_2'];

$OT3 = $row['OT_3'];

$tom = $row['TOM'];

$totm = $row['TOTM'];

$notes = $row['Notes'];

}

}

$result->close();

.

.//I did a lot of SQL select and use that to create htmltable

.

$output .= '

'.$row['string_20_1'].''.$row['string_20_2'].'

.

.//

...

.

'.$notes.'

';

}

.

.//some codes

.

$strSql01 = "SELECT * FROM manufacturejobschedulingpersonal where string_20_1 = '".

$row['string_20_1']."' AND"." date_format(DateTime_1,'%Y-%m-%d') = '$newformat'";

$result01 = $conn->query($strSql01);

if ($result01->num_rows > 0) {

while ($row01 = $result01->fetch_assoc()) {

.

.//some codes

.

}

}

$result01->close();

.

.//some codes

.

$result->close();

$conn->close();

echo $optionUse.'?'.$checkboxVerify.'?'.$output.'?'.$hasCheckDate;

?>

save.php

session_start();

include_once '../control/mysql_start.php';

$arrayObjs = $_POST;

.

.//some codes

.

$msDanger = '';

foreach($arrayObjs as $array)

{

foreach($array as $row)

{

$UserId = $row['UserId'];

$UserName = $row['UserName'];

.

.//some codes

.

$strSql = "SELECT * FROM manufacturejobschedulingpersonal where string_20_1 = '".

$UserId."' AND"." date_format(DateTime_1,'%Y-%m-%d') = '$DateTime_1'";

$result = $conn->query($strSql);

if( $result->num_rows > 0) {

if ($table == 'main') {

$strSql = "Update manufacturejobschedulingpersonal SET String_10_1 ='$String_10_1', String_Assist01 ='$assist_1',String_Assist02='$assist_2' where string_20_1 = '".

$UserId."' AND"." date_format(DateTime_1,'%Y-%m-%d') = '$DateTime_1'";

} else {

$strSql = "Update manufacturejobschedulingpersonal SET String_10_1 ='$String_10_1' where string_20_1 = '".

$UserId."' AND"." date_format(DateTime_1,'%Y-%m-%d') = '$DateTime_1'";

}

$result = $conn->query($strSql);

} else {

$strSql = "INSERT INTO manufacturejobschedulingpersonal (string_20_1,string_20_2,YM,DateTime_1,String_10_1,String_Assist01,String_Assist02)".

"VALUES ( '$UserId', '$UserName', '$YM', '$DateTime_1', '$String_10_1','$assist_1','$assist_2')";

$result = $conn->query($strSql);

}

.

.//A lot of sql CRUD

.

}

}

$conn->close();

$last_line = exec('java -jar C:/CCERP/ChainCodeERP/ExtraModule/HRMultiOTCheck/HRMultiOTCheck.jar -ssa '.$javaDate.' ' .$javaDepId, $return_var);

echo 'Updated';

?>

来源:https://stackoverflow.com/questions/40200382/php-fatal-error-could-not-queue-new-timer-in-unknown-on-line-0

.php on line 0,PHP Fatal error: Could not queue new timer in Unknown on line 0相关推荐

  1. .php on line 0,控制台运行php报错 undefined symbol: gdImageCreateFromJpeg in Unknown on line 0 解决方法...

    之前把homestead中的nginx替换为openresty后就发现php控制台运行时会报一个错: undefined symbol: gdImageCreateFromJpeg in Unknow ...

  2. Photoshop2020 安装失败FATAL: Error (Code = 146)

    @[TOC](Photoshop2020 安装失败FATAL: Error (Code = 146) ) Photoshop2020 安装失败提示:FATAL: Error (Code = 146) ...

  3. ORA-39126: Worker unexpected fatal error in KUPW$WORKER.FETCH_XML_OBJECTS [ORA-04063: view “SYS.KU$_

    今天expdp导出数据库,遇到了ORA-39126: Worker unexpected fatal error in KUPW$WORKER.FETCH_XML_OBJECTS [ORA-04063 ...

  4. [php] Fatal error: Class Exception not found in

    初学PHP时出现的bug Fatal error: Class '*\Exception' not found in D:\***.php on line Call Stack 场景是在学习try c ...

  5. 使用友元,编译出错fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) 的解决...

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明 http://lihuan-dianxian.blogbus.com/logs/42102230.html 同学拿了个很简单的小程序过 ...

  6. Fatal error: Cannot use 'Object' as class name as it is reserved in xxx/Object.php on line 77

    今天闲来无事将自己本机的开发环境换成了PHP 7.2.0 Beta 3,尤其是PHP7大版本后PHP版本的更新很快. 使用yii2出现的错误 在更新到PHP7.2测试版后出现的错误: Fatal er ...

  7. VC6.0的一个编译错误:fatal error C1001: INTERNAL COMPILER ERROR。

    最近在编译一个VC6.0工程(开发环境:win2000+VS6.0+Sp6),在加入预编译头后出现了下面的编译错误提示: c:/program files/microsoft visual studi ...

  8. PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0

    为什么80%的码农都做不了架构师?>>>    不同电脑,相同的代码怎么就上传不了图片:本人用的是PHP upload上传项目下的retime文件夹 服务器突然出现这种提示,无法上传 ...

  9. kafka 集群启动失败:FATAL [KafkaServer id=0] Fatal error during KafkaServer startup.

    在测试 kafka 集群时,关闭 kafka 后,再次启动 kafka 集群时,遇到此问题,具体内容如下: FATAL [KafkaServer id=0] Fatal error during Ka ...

最新文章

  1. Spring Cloud Alibba教程:Sentinel的使用
  2. 【敬初学者】Python基础学完了,该怎么知道自己学的怎么样呢?十个经典实战小项目附源码
  3. ADO.NET学习笔记--数据分组
  4. java 管理员命令模式_java中命令模式详解和使用方法
  5. 626B. Cards
  6. 中职 计算机原理 计算题,中职《计算机原理》测验2.doc
  7. unity3d进行脚本资源打包加载
  8. 翻译记忆软件-塔多思TRADO经典教程_2
  9. 微信公众号音频在线下载工具 微信公众号音频下载工具 微信公众号视频下载工具
  10. Android图形shape的gradient渐变色背景
  11. 吸烟行为检测系统(Python+YOLOv5深度学习模型+清新界面)
  12. 逆序输出数组,将给定数组逆序输出
  13. Fiddler-使用教程
  14. 解决AE在mac big sur系统上安装闪退打不开问题,最新After Effects 2021 for Mac中文直装(ae 2021 mac)详细安装教程
  15. 使用动态ip上网稳定吗?
  16. 会计 制造费用转生产成本
  17. 阿峥教你实现UITableView循环利用
  18. 024 Rust死灵书之Send和Sync
  19. 异步电动机的三种仿真方式
  20. 数据分析的指南针--数据分析方法论(结合案例)

热门文章

  1. S3C2440 开发板实战(8):中断驱动
  2. 数据结构初阶——链式二叉树
  3. 【关于python中整除与取余】
  4. NAT地址转换协议学习
  5. SQLMap使用|命令大全(干货)
  6. Python「可视化编程插件」让编程更easy
  7. WPF中MaterialDesignThemes前端框架的使用(超详细图解步骤)
  8. idea右侧没有maven,main方法无启动图标解决方法
  9. 《Redis系列第三篇、incr与decr使用|CSDN创作打卡》
  10. 05吸收应用:会整理还不够?教你吸收、联想、输出、应用