Fail to obtain the computer information from php5.3

Source: Internet
Author: User
Fail to obtain the computer information from php5.3 // Phpinfo ();

// Exit;
/** Obtain the hard disk serial number */
Function getDiskSID (){
$ Sid = array ();
$ Wmd = new COM ("Winmgmts: //./root/cimv2 ");
$ Wqd = $ wmd-> ExecQuery ("Select * From Win32_DiskDrive ");
Foreach ($ wqd as $ row ){
$ Sid [] = $ row-> PNPDeviceID;
}
Return $ sid;
}

/** Obtain the CPU serial number */
Function getCpuSID (){
$ Sid = array ();
$ ObjLocator = new COM ("WbemScripting. SWbemLocator ");
$ Wmi = $ objLocator-> ConnectServer ();
// $ Info = $ wmi-> Get ("Win32_PnPEntity ");
$ Info = $ wmi-> Get ("Win32_Processor ");
$ ArrProp = $ info-> Properties _();
$ ArrWEBMCol = $ info-> Instances _();
Foreach ($ arrWEBMCol as $ objItem ){
$ Sid [] = $ objItem-> ProcessorId;
}
Return $ sid;
}

/** Obtain the serial number of the motherboard */
Function getBoardSID (){
$ Sid = array ();
$ ObjLocator = new COM ("WbemScripting. SWbemLocator ");
$ Wmi = $ objLocator-> ConnectServer ();
$ Info = $ wmi-> Get ("Win32_BaseBoard ");
$ ArrWEBMCol = $ info-> Instances _();
Foreach ($ arrWEBMCol as $ row ){
$ Sid [] = $ row-> SerialNumber;
}
Return $ sid;
}

Var_dump (@ getBoardSID ());
Var_dump (@ getDiskSID ());
Var_dump (@ getCpuSID ());


The younger brother of MySQL 5.2 is here to help you.


Reply to discussion (solution)

Since php5.3, the COM extension is no longer loaded by default.
Php. ini
Extension = php_com_dotnet.dll

Moderator. I don't know where to download it.

You do not need to download. the ext directory contains

What is the function of retrieving this item? Is the program bound to a computer?

Well, that's it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.