Nice solution!
The reason you can't get the MD5 + Base64 functions in PHP to produce the same result as your openssl command line is probably that you use "echo" without the "-n" flag. You have in effect encoded the MAC address plus a line feed character, which produces a completely different...