How to Acquire CPU Temperature and CPU Frequency Using PHP
This article is in English. Sometimes the sentences are wrong. Please be understanding of this beforehand.
How to Acquire the CPU Temperature Using PHP
The temperature displayed is celsius.
echo round((exec('cat /sys/class/thermal/thermal_zone0/temp')/1000),2);
How to Acquire the CPU Frequency Using PHP
The unit displayed is MHz. If there are 4 cores, cpu0 to cpu3.
echo round((exec('cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq')/1000),2);
Raspberry Pi is used for the server. By introducing “Insert PHP” in WordPress you can run PHP with widget.
Change the frequency and check the operation.