PHP DLL file UUID extension for windows

When I tried to connect to Apache Cassandra server using php code, I got the error "Fatal error: Call to undefined function uuid_make ()". I can find that the PHP UUID extension was missing from the PHP installation. Can anyone suggest where I can download the DLL file to install PHP on my Windows 7 machine.

+2


a source to share


2 answers


Since there is no DLL file for the PHP UUID extension available on the web ... you need to compile it from source. It shouldn't be too hard ...

Download it here: http://pecl.php.net/package/uuid



Follow the instructions here: http://php.net/manual/en/install.pecl.windows.php

You can also install directly from PECL, instructions are here: http://wiki.php.net/internals/windows/stepbystepbuild

+2


a source


Unfortunately, the UUID PECL extension is OS dependent and will only work on Linux (including OS X) or Solaris.

In windows, you have several alternatives:



  • Check out com_create_guid ( http://php.net/manual/en/function.com-create-guid.php ) which is a Windows only function.

  • MySQL has a UUID function ( http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html#function_uuid ) which will generate UUID, use something like "SELECT UUID ()" as your SQL query. (I have not tested this is available in Windows builds, if you use it please post an answer so everyone knows how you did it)

  • If you don't care about the uniqueness of your UUID (the reason the UUID should be as valid as possible is that you won't generate two of the same values ​​in your application's entire life), then you can try some clean PHP implementation. These are not the most desirable solutions and I would never do this in production, but it may be enough for your needs - there are many opportunities for inspiration on the internet.

+2


a source







All Articles