Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7788337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:58:02+00:00 2026-06-01T20:58:02+00:00

I wrote this PHP function: <?php //windows cpu temperature function win_cpu_temp(){ $wmi = new

  • 0

I wrote this PHP function:

<?php
//windows cpu temperature
function win_cpu_temp(){
    $wmi = new COM("winmgmts://./root\WMI");
    $cpus = $wmi->execquery("SELECT * FROM MSAcpi_ThermalZoneTemperature");
    foreach ($cpus as $cpu) {
        $cpupre = $cpu->CurrentTemperature;
    }
    $cpu_temp = ($cpupre/10)-273.15 . ' C';
    return $cpu_temp;
}
echo win_cpu_temp();
?>

My problem, is that the script displays 59.55 C which I had thought was correct. I checked this value several hours later, and it’s exactly the same. I just put the CPU to work at 90% compressing video for ten minutes, and this value is the same still.

Can anyone help me find the “true” value for this function?

I’ve read (to no avail):
MSAcpi_ThermalZoneTemperature class not showing actual temperature

How is, say, “Core Temp” getting its values? Same computer, it reports between 49 and 53 Celsius.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:58:04+00:00Added an answer on June 1, 2026 at 8:58 pm

    With a little digging around I found the common issue with using MSAcpi_ThermalZoneTemperature was that it is dependent upon being implemented on your system.

    You could try querying Win32_TemperatureProbe and see if you have any luck there.

    Neither MSAcpi_ThermalZoneTemperature or Win32_TemperatureProbe worked on my system, although if you have admin access, you can use http://openhardwaremonitor.org/ which provides a WMI interface for all available sensor data.

    This worked great for me and I was able to accurately report CPU Core temp from a PHP script:

    function report_cpu_temp(){    
        $wmi = new COM('winmgmts://./root/OpenHardwareMonitor');
        $result = $wmi->ExecQuery("SELECT * FROM Sensor");
        foreach($result as $obj){
            if($obj->SensorType == 'Temperature' && strpos($obj->Parent, 'cpu') > 0)
                echo "$obj->Name ($obj->Value C)"; // output cpu core temp
            else
                echo 'skipping ' . $obj->Identifier ;
            echo '<br />';
        }
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a PHP code like this $site=http://www.google.com; $content = file_get_content($site); echo $content; But
I copied this code (in spanish) http://www.elrincondelc.com/nuevorincon/index.php?pag=codigos&id=4 and wrote a new one. This is
I wrote this PHP code to make some substitutions: function cambio($txt){ $from=array( '/\+\>([^\+\>]+)\<\+/', //finds
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I wrote this code (which posts to a PHP page) so that if guests
Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this
Is it possible to execute cmd commands in Windows OS with PHP exec() function?
Working on this page: http://www.karlsenner.dreamhosters.com/about.php and having trouble with the navigation in IE6. It
I wrote the PHP function below to download files and it works as expected.
I'm following this tutorial about building a multilingual web sites using PHP gettext http://onlamp.com/pub/a/php/2002/06/13/php.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.