Php modifies the system time does not work

now you need to modify the operating system time with PHP. The system is currently centos

.

my code

<?php
//$cmd = "date -s "20181123 08:00:00"";
//$cmd = "timedatectl set-time 2018-11-23 08:00:00";
$cmd = "reboot";
echo date("Y-m-d H:i:s")."<br/>";
$output = shell_exec($cmd);
shell_exec("hwclock --systohc --localtime");
shell_exec("clock w");
echo "
";
echo $output;
echo "========================"."<br/>";
echo date("Y-m-d H:i:s")."<br/>";
?>

the situation in the process

first I have confirmed that the server can execute the function shell_exec. For example, there is no problem with executing shell_exec ("ls-a").
neither changing the system time nor rebooting the system seems to work.

the bosses who want to know can help to see or analyze what the problem is.

Jan.17,2022

under what permissions does your PHP container run?


what does your reboot mean? The
operating system has been rebooted. Can the following statements still be executed?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd6b4d-526bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd6b4d-526bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?