When you are connecting with PHP, are you simply running a PHP application, or is this through Apache? If it's Apache, the Apache server is running as a service. On XP, this was not a problem. But starting with Vista, a shared memory connection from a service could not connect to a server that was NOT running as a service, and vice versa. This is why it works on the XP machine and not on Windows 7.
You need to enable TCP/IP on your engine using "-x tcpip" and add "HOST=localhost" to the connection string used by PHP.