Get cpu serial number with php

I need a portable php lib to get cpu and/or HD serial number and other physical addresses if there is any. I know on php it needs exec or shell command but is there a such RELIABLE lib on packagist or github?

anything that builds on proc_open(). e.g. symfony/process

1 Like

Thanks. It was very useful. But on all platforms this is not the same command or the file you should look into get cpu/HD serial numbers. By “portable lib” to do so, I meant that. Is there anything useful?

I doubt there is one. just consider the differences between Linux & Windows.

1 Like

Just off topic: run() of symfony process is switchable between all available commands? For example if any of passthru, shell, shell_exec, exec is disabled, it will find the one will work automatically?

This is what I wrote to my host. I am root.

I tried to install “yum install dmidecode” to get cpu serial number but when I try to run a command I get “not permitted” error.

  1. Please fix our dmidecode.
  2. Let us know how we can get cpu and HD serial number of our vps?

At meanwhile, any idea why dmidecode may return not permitted error as I am root?

No. symfony/process exclusively uses proc_* functions as the others are too restricted.

1 Like

Wrong operating system? =>

According to phpinfo
System Linux **** 2.6.32-042stab116.1 #1 SMP Wed May 4 16:21:02 MSK 2016 x86_64

So probably not a wrong OS!

What is the best way to get cpu/HD serial number on *nix series?

Never needed to know that, so I have no idea.

According to this info is machine-id useful for licensing beside mac or it may be changed on each reboot?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.