Can’t create TCP/IP socket (10106)

This post may help some other Windows/Apache/Mod-fcgid users out.

We recently migrated a windows 2000 Apache install to a Windows Server 2003 box.

Despite having all the mysql libs, the pho_sockets module etc configured php kept failing to connect to a mysql localhost with the error “Can’t create TCP/IP socket (10106)

After much googling and little answers (though many others having the same problem) I realised that in my httpd.conf in the section where we set runtime values for the PHP (such as PHP_RC, TEMP FOLDER etc.) included the path C:\WINNT which of course was fine on windows 200 but on Server 2003 should have been C:\WINDOWS.

Once all these paths were changed and apache started, all was well.

My guess is that php_sockets is dependent upon windows winsock implementation and with duff paths being passed to php-cgi.exe the winsock library could not be loaded and hence all socket stuff failed.

I’m only guessing though. Whatever the reason it’s unimportant since there was a clear problem with the paths.

Hope this saves someone else a couple of hours!

This entry was posted in Windows Apache MySQL PHP and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>