# Windows port

There is no official Windows port of libvirt-php available yet but if you want to write the Windows port we would appreciate it.

Since libvirt is known to be running on Windows (please refer to Information on libvirt Windows port) it should be possible and reasonable to create the libvirt-php port for Windows based operating systems, i.e. in the form of Windows dynamic linked library for Windows version of PHP.

## Preparations for libvirt-php Windows port

If you are interested in writing Windows port you should download the current codebase from the GIT repository and create a patch adding the Windows port itself. Before you do so you have to compile libvirt on Windows to be able to access it using the Windows dynamic linked (DLL) library. For more information about getting libvirt client to install on Windows box please refer to Information on libvirt Windows port).

## Reference materials on writing Windows libraries/applications under Linux

If you seek for some reference information about Windows application/libraries programming under the Linux operating system please refer to author's programming guide at Windows programming under Linux programming guide. Also, there are some other references useful like:
Linking .a library to a VS2008 static library
Stdcall and DLL tools of MSVC and MinGW
Win32 PHP Extension Development
Google search results

## Notes on writing PHP extensions under Windows

The situation seems to be pretty complicated for Windows version of PHP since there's no phpize tool or php-config to prepare the module for you. There are some pointers on the internet how to write PHP extensions under Windows systems however all of them are using Visual C++ compiler (although Express edition should be fine I have allocated some of my spare time to investigate this further but I was unable to make it work because of some errors in Zend header files). Steps using Visual Studio (C++) could be found at http://netindonesia.net/blogs/risman/archive/2008/06/15/part-2-writing-php-extension.aspx but this is the one I tried and that was not working for me.