This page was running perfecctly form months. The only thing that has changed is the upgrade of the MS MDAC to use ASP and SQL Server on the same machine. The Perl script that runs continously (activestate) is connecting to MySQL just fine.

I have tried reinstalling PHP.

The message:

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10091) in e:\1webs\universal\report.php on line 72
Unable to connect to database

Thanks!

    This is the description of socket error 10091:

    WSASYSNOTREADY
    (10091)
    Network subsystem is unavailable.
    This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check:
    That the appropriate Windows Sockets DLL file is in the current path.
    That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one WINSOCK DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded.
    The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly.

    Dave

    ===========================================
    http://badblue.com
    Small footprint P2P web server for Windows,

    File-sharing, PHP, wireless apps & more

      Hmm,

      Only one dll is on the server and it is in the path. Php seems to be the only thing broken.

        a month later

        i'm having the same error all of a sudden... any help would be great. especially if you have resolved the issue

          I still have not taken teh time to investigate this. As it stands right ow it definatly happend after upgrading the SQL Server MDAC. PHP still works but no connections to a local database, I have not tried a remote DB yet.

          -- Paul

            I know this isn't very helpful, but I'm now having the same problem. I'm running windows 2000 - I went to bed at about 2am and everything was working fine. I woke up this morning - it appears that my machine had it's power cycled in the middle of the night. (I had to log onto the system fresh). Once logged on, I got the same error you guys have been getting.

              Well, I did a few things, not the least of which was rebooting. I also uninstalled some webcam software that I thought might be causing the problem, etc. It didn't seem to help. At some point, I uninstalled the MySQL service (via right-clicking on the little traffic light in the system tray, and choosing stop the service and then remove the service.) After that, I ran the server standalone from the same menu - was still having problems with it (the page that called mysql would just time out). I then stopped the standalone process, and reinstalled the service and started it (all still via the system tray icon). It works now.

              http://www.lagdaddy.com/questia - it's a list of former co-workers from my last job, being populated from the database.

                11 days later

                I get the same problem, it happened for no reason at all 😡 and your soloution doesn't work for me. I have tried messin around with everything but nothing has changed.

                Someone.....help meh........


                MySQL said: Back

                I said: Why you little piece of $~(& (£"")*~@: #:~} {#;]][ and you smell....

                  16 days later

                  I am having the same problem with TCP/IP. Like previous posts, it just started one day. I am not using PHP or SQLServer but was doing some Java development and I noticed that I couldn't call accept() on a socket. I fooled around with some stuff for a while and the I ended up reinstalling TCP/IP and when that didn't work, I reinstalled Win2K (in place installation). Still no luck.

                  If anyone figures this one out, please e-mail me.

                    6 days later

                    I have now re-installed and upgraded bot PHP and MySQL and still get the message:

                    Warning: Undefined variable: MYSQL_TCP_PORT in e:\1webs\jac\test.php on line 4

                    From the test function. The php.ini says:
                    ; Default port number for mysql_connect(). If unset, mysql_connect() will use
                    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
                    ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
                    ' at MYSQL_PORT.
                    mysql.default_port =

                    I am going to attmept to add the MYSQL_PORT variable to Windows

                      The error I have been suffering is a little but different, but not much:
                      Can't create TCP/IP socket (10160)

                      My conf. is PHP 4.0.5 and BadBlue PE webserver on WNT, and remote mySQL database at freesql.org,

                      Running the scripts from command line (i.e. with php.exe) works fine, but from browser they die with that error code.

                      I have even tried locating the scripts at my ISP space, and I have to suspect the same error is happening for the ISP is redirecting output to a blank internal error page, from which I cannot retrieve error codes at all.

                      If anybody finds a fix for this, please let me know. I am desperate.

                      Javier

                        If you're on NT, try setting up IIS to run PHP. See if that does it. It might be a permission problem of some sort?

                        RW

                          I added teh variable to windows and it had no effect. The following message on this board from Javier tells me it is PHP and not MySQL. I was also able to work PHP off a laptop back into the same database. So permissions on the port are not an issue.

                            I tried with the command line and the results were the same. No Good.

                              Hi all,

                              I finally got it working on my ISP account. The trick was to explicit the IP address and port for the database host:

                              mysql_connect("66.31.176.185:3306", ......);

                              It seems my ISP has disabled name resolution for some PHP functions in order to filter on IP addresses.

                              From BadBlue PE under NT, no success at all. I have tried every little thing I though about. IMHO, BadBlue server is closing some doors to PHP when this is invoked from it. I guess that under NT, the way PHP inherits BB resources and handlers (i.e. the way the app is spawned) is affecting its permissions to create a particular socket. I would suspect of the way Winsock is being initialized also.

                              Still, if anyone finds a fix for this under NT, I am very interested. BB server is light and fast and serves me well as a testing platform before I actually roll out my pages to the net.

                              Good Luck!

                                5 months later

                                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

                                  Write a Reply...