I've had similar symptons but I get Can't create TCP/IP socket (10106), and eventually managed to fix it in my environment. (Orion 1.5.2, NT4 SP6, MySql 3.23.40-nt).
Other posts suggest that WSAEPROVIDERFAILEDINIT (10106) is caused by the layered service provider failing during init. The most common cause suggests it's because it can't load a winsock DLL. Elsewhere on the web I found a general item on winsock that suggests it fails if it can't see the environment variable 'ServerRoot' which typically points to 'c:\winnt'.
I modified the script that was connecting to MySql and included a call to phpinfo() which outputs a lot of useful info, including what environment variables have been set. I also included some debug to see what getEnv("SystemRoot") returned. Running php from the command line showed SystemRoot to be set correctly and the connect to MySql was successful. Running the same script from within the browser showed no environment variable was set and the connection failed.
Orion executes PHP via a servlet. I had to include init parameters to the servlet in global-web-application.xml where the PHP servlet entry is defined. I think this may be specific to Orion, but no doubt the reason for this failure under NT is for similar reasons in other web servers.
<servlet>
<servlet-name>php</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>environment</param-name>
<param-value>SystemRoot=c:\winnt</param-value>
</init-param>
<init-param>
<param-name>interpreter</param-name>
<param-value>php</param-value>
</init-param>
</servlet>
HTH